sushma_proach

post with content, custm post type

Apr 7th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php if (have_posts()) :
  2. while (have_posts()) :
  3. the_post();
  4. the_content();
  5. endwhile;
  6. endif;
  7. ?>
  8.  
  9. <?php
  10. $args = array( 'posts_per_page' => 5, 'category_name' => 'Team' );
  11.  
  12. $myposts = get_posts( $args );
  13. foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
  14. <li>
  15. <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  16. </li>
  17. <?php endforeach;
  18. wp_reset_postdata();?>
Add Comment
Please, Sign In to add comment