Advertisement
sgaffney

bbpress topics loop

Nov 3rd, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1.         <?php
  2.  
  3.         // Query defaults
  4.         $topics_query = array(
  5.             'author'         => 0,
  6.             'show_stickies'  => false,
  7.             'parent_forum'   => 'any',
  8.             'posts_per_page' => 5,
  9.             'order'          => 'DESC',
  10.         );
  11.  
  12.         bbp_set_query_name( 'bbp_is_topic_archive' );
  13.  
  14.         // Before topics index
  15.         do_action( 'bbp_template_before_topics_index' );
  16.  
  17.         // Load the topic index
  18.         if ( bbp_has_topics( $topics_query ) ) {
  19.             bbp_get_template_part( 'bbpress/pagination', 'topics'    );
  20.             bbp_get_template_part( 'bbpress/loop',       'topics'    );
  21.             bbp_get_template_part( 'bbpress/pagination', 'topics'    );
  22.  
  23.         // No topics
  24.         } else {
  25.             bbp_get_template_part( 'bbpress/feedback',   'no-topics' );
  26.         }
  27.  
  28.         // After topics index
  29.         do_action( 'bbp_template_after_topics_index' );
  30.  
  31.         bbp_reset_query_name();
  32.  
  33.         ?>
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement