Skip to:
Content
Pages
Categories
Search
Top
Bottom

Recent replies list

  • @kasperdalkarl

    Participant

    Hi there!

    I have been trying to following this guide to add a list of recent topics before the forum categories: https://www.daggerhart.com/bbpress-recent-replies-shortcode/

    I have put the code in the functions.php file, and <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic]’) ?> in loop-forums.php

    After having done this the code isn’t visible, so I am wondering if I have made a mistake. Could anyone be so kind and shed some light on how to make this work?

    My forum can be found on http://www.talanrien.com/forums

    I am running WordPress 4.9.1 with Bbpress version 2.5.14

    As a bonus question I was also wondering if anyone know if it’s possible to ad a shoutbox/chatbox at the bottom of the forum?

    Thank you!

    Best wishes,
    Kasper

Viewing 5 replies - 1 through 5 (of 5 total)
  • @robin-w

    Moderator

    whereabouts in loop-forums.php did you put it ?

    @kasperdalkarl

    Participant

    Currently it looks like this:

    <?php

    /**
    * Forums Loop
    *
    * @package bbPress
    * @subpackage Theme
    */

    ?>

    <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic]’) ?>

    <?php do_action( ‘bbp_template_before_forums_loop’ ); ?>

    <ul id=”forums-list-<?php bbp_forum_id(); ?>” class=”bbp-forums nk-forum”>

    <?php while ( bbp_forums() ) : bbp_the_forum(); ?>

    <?php bbp_get_template_part( ‘loop’, ‘single-forum’ ); ?>

    <?php endwhile; ?>

    <!– .forums-directory –>

    <div class=”nk-gap-2″></div>

    <?php do_action( ‘bbp_template_after_forums_loop’ ); ?>`

    @robin-w

    Moderator

    not sure why, but adding show seems to fix

    <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>

    @kasperdalkarl

    Participant

    I tried to do that now and update the file, but still no change.

    <?php

    /**
    * Forums Loop
    *
    * @package bbPress
    * @subpackage Theme
    */

    ?>

    <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>

    <?php do_action( ‘bbp_template_before_forums_loop’ ); ?>

    <ul id=”forums-list-<?php bbp_forum_id(); ?>” class=”bbp-forums nk-forum”>

    <?php while ( bbp_forums() ) : bbp_the_forum(); ?>

    <?php bbp_get_template_part( ‘loop’, ‘single-forum’ ); ?>

    <?php endwhile; ?>

    <!– .forums-directory –>

    <div class=”nk-gap-2″></div>

    <?php do_action( ‘bbp_template_after_forums_loop’ ); ?>

    @robin-w

    Moderator

    ok, remove the whole line

    <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>

    then add this to your functions

    add_action( 'bbp_template_before_forums_loop', 'call_bbpress_recent_replies_by_topic' ); 
    
    function call_bbpress_recent_replies_by_topic () {
    	echo do_shortcode("[bbpress_recent_replies_by_topic show=5]") ;
    }

    This just hooks to the line after the one you’d added

    <?php do_action( ‘bbp_template_before_forums_loop’ ); ?>

    so saving you having to amend that template.

    This works on my site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar