Skip to:
Content
Pages
Categories
Search
Top
Bottom

undefined function bp_has_forum_topics()


  • targanought
    Participant

    @targanought

    I’m trying to pull some group / forum information over into one of my custom template pages (in the theme directory).

    But this line gives me an “undefined function”:
    <?php if ( bp_has_forum_topics( 'user_id=' . bp_loggedin_user_id() ) ) : ?>

    There is no problem with:
    <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() ) ) : ?>

    Basically the installs of WP, BP and bbP are very fresh: WordPress 3.6.1, BuddyPress 1.8.1, bbPress 2.4.1. Groups and group forums seem to be working fine using the standard management pages.

    Anything else I have to do to use the forum topic functions in my code?

    Dan

Viewing 4 replies - 1 through 4 (of 4 total)

  • modemlooper
    Moderator

    @modemlooper

    Do you have bbPress forums turned on for groups? What template are you placing code into?


    targanought
    Participant

    @targanought

    Under Settings->Forums I have checked “Allow BuddyPress Groups to have their own forums”.

    I have successfully set up two groups, each with a forum, and a site-wide forum, using the normal admin pages. So it all seems to work fine.

    I’m putting the above code into my own template file (originally based on Responsive, which doesn’t have any BP/bbP -specific code in it otherwise.


    modemlooper
    Moderator

    @modemlooper

    When accessing bbPress in WP templates you use bbPress template tags. bp_has_forum_topics will only work in BP templates.

    if ( bbp_has_topics( '&author=' . bp_loggedin_user_id() ) ) :


    targanought
    Participant

    @targanought

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘undefined function bp_has_forum_topics()’ is closed to new replies.
Skip to toolbar