Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <<NEXT [SELECT] PREV>>
  2.  
  3. <option value="link/page1">Page 1</option>
  4. <option value="link/page2">Page 2</option>
  5.  
  6. function yorumlariSayfala ( $args = array() ) {
  7. global $wp_rewrite;
  8.  
  9. if ( ! is_singular() )
  10. return;
  11.  
  12. $page = get_query_var('cpage');
  13. if ( !$page )
  14. $page = 1;
  15. $max_page = get_comment_pages_count();
  16. $defaults = array(
  17. 'base' => add_query_arg( 'cpage', '%#%' ),
  18. 'format' => '',
  19. 'total' => $max_page,
  20. 'current' => $page,
  21. 'echo' => true,
  22. );
  23. if ( $wp_rewrite->using_permalinks() )
  24. $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
  25.  
  26. $args = wp_parse_args( $args, $defaults );
  27. $page_links = paginate_links( $args );
  28.  
  29. if ( $args['echo'] )
  30. echo $page_links;
  31. else
  32. return $page_links;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement