Wordpress and Webdesign Forum go41 » bbpress discussion

  1. It took a while to find out that bbPress 0.9.0.5 doesn't use pagination on the frontpage.
    Having more topics than what is set in admin under 'Items per page:' will make the older ones disappear.
    It took a while to find the plugin 'Topics Per Page' ( http://bbpress.org/plugins/topic/front-page-topics/ ) which gives you a pagination bar with page numbers.

    Installation went easy, putting it in the my-plugins/ folder after setting the number of topics or posts I wanted on each page. Edit topics-per-page.php to do this.

    Now in front-page.php you still have to place the call for the function front_page_pages(); AFTER <?php endforeach; endif; // $topics ?> </table>

    Sure putting this code in the file and not activating the plugin first will make your frontpage stop running after this call. It's better to check first 'if function_exists'

    In my front-page.php it looks like this now:

    <?php endforeach; endif; // $topics ?>
    </table>
    <?php	if (function_exists('front_page_pages')) { ?>
    <div class="nav"><?php front_page_pages(); ?></div>
    <?php } // end front_page_pages ?>

    Where the first two lines should be already in your file!

    Finally in readme.txt it says 'if you use rewrite slugs you MUST add a rule to your .htaccess'

    The suggested rule RewriteRule ^page/([0-9]+)/?$ /forums/?page=$1 [L,QSA] works well if your forum is installed in a folder called /forums/

    I installed it in the root folder of a subdomain, so for this installation I used

    RewriteRule ^page/([0-9]+)/?$ /?page=$1 [L,QSA]

    Now I enjoy pagination on the frontpage of bbPress, thanks to the Contributors _ck_ and mdawaffe

    Posted 2 years ago #
  2. get the title tag in header.php display the current page

    switching pages works well with the plugin explained above, but the title of the forum will always just show the forums name.

    On page two however we have another URL and different topics, so the title should reflect this.

    In a similar way as in WordPress you can easily add 'page X' to the title if it is paged and if you are on front-page.

    In header.php you find:

    <title><?php bb_title() ?></title>

    by adding 'if (is_front() && $page>1)' you can echo the page number if it is paged. It should look like this:

    <title><?php bb_title() ?><?php if (is_front() && $page>1) {echo(" page $page" ); } ?></title>

    Now, if you switch to page 2 it will display 'your forums name page 2'

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.

Join us! or log in (lost password?):