Guest User

Untitled

a guest
Jun 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. $posts = get_posts( array(
  4. 'orderby' => 'id',
  5. 'category' => 1,
  6. 'posts_per_page' => 999
  7. ) );
  8. if ( $posts ) {
  9. foreach ( $posts as $post ) :
  10. setup_postdata( $post ); ?>
  11.  
  12. <h4><?php the_title(); ?></h4>
  13. <p><?php the_content(); ?></p>
  14.  
  15. <?php
  16. endforeach;
  17. wp_reset_postdata();
  18. }
  19. ?>
  20.  
  21. <?php
  22. $posts = get_posts( array(
  23. 'orderby' => 'id',
  24. 'category' => 1,
  25. 'numberposts' => -1 // -1 означает все записи
  26. ) );
  27. foreach ( $posts as $post ) {
  28. ?>
  29. <h4><?php $post->post_title; ?></h4>
  30. <p><?php $post->post_content; ?></p>
  31. <?php
  32. }
  33. ?>
Add Comment
Please, Sign In to add comment