Advertisement
kobial8

Global Post Query

Feb 13th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2. global $post;
  3. $args = array( 'posts_per_page' => 4, 'post_type'=> 'post','category_name' => 'sports');
  4. $myposts = get_posts( $args );
  5. foreach( $myposts as $post ) : setup_postdata($post); ?>
  6.  
  7. <?php
  8. $promotions_icon = get_post_meta($post->ID, 'promotions_icon', true);
  9. ?>
  10. // Put your content here
  11. <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement