Guest User

Untitled

a guest
Jan 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
  2. ?>
  3. <?php
  4. $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
  5. $qury = query_posts(array ('paged' => $page,
  6. 'post_type' => 'articles',
  7. 'author' => $curauth->id,
  8. 'order' => 'DESC',
  9. 'posts_per_page' => 1,
  10. ));
  11. if(have_posts()){ while(have_posts()){ the_post();
  12. wp_blog_pagination();
  13. }}
  14. else echo '';
  15. ?>
  16.  
  17. $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
  18.  
  19. $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
  20. $args = array (
  21. 'paged' => $page,
  22. 'post_type' => 'articles',
  23. 'author' => $curauth->id,
  24. 'order' => 'DESC',
  25. 'posts_per_page' => 1,
  26. );
  27.  
  28. $query = new WP_Query( $args );
  29.  
  30. if( $query->have_posts() ) {
  31. while( $query->have_posts() ) {
  32. $query->the_post();
  33. wp_blog_pagination();
  34. }
  35. } else {
  36. echo '';
  37. }
Add Comment
Please, Sign In to add comment