Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function looptest_shortcode($atts){
- extract( shortcode_atts( array(
- 'expand' => '',
- ), $atts) );
- ob_start();
- $one = array(
- 'post_type' => 'post',
- 'post_status' => 'publish'
- );
- $the_query = new WP_Query($one); ?>
- <?php while ($the_query -> have_posts()) : $the_query -> the_post(); the_title(); the_content(); endwhile; wp_reset_postdata(); return ob_get_clean(); ?>
- <?php }
- add_shortcode('looptest_post', 'looptest_shortcode');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement