Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] bp_has_forum_topics() returns empty


  • boriskamp1991
    Participant

    @boriskamp1991

    Hi guys, in my custom theme I would like to display the latest forum topics. In order to do so I thought I could use this function So I copied the html/php code in my frontpage.php. It returns nothing, not even the

    Sorry, there were no forum topics found.

    message.

    I turned WP_DEBUG to true and found this message:
    Fatal error: Call to undefined function bp_has_forum_topics() in /Users/boriskamp/Documents/Local Websites/MSM/wp-content/themes/Military-Scale-Modelling/front-page.php on line 122
    Im using a child theme of the BuddyBoss theme.

    what’s wrong here?
    Thanks!

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

  • Henry Wright
    Moderator

    @henrywright

    Hi @boriskamp1991

    The error message is telling us that the undefined function bp_has_forum_topics() is being used in your theme’s front-page.php on line 122. I suspect you don’t have forums activated?


    boriskamp1991
    Participant

    @boriskamp1991

    Hi @henrywright,

    It does, but I have not found out why. the forums are activated and running on my test site.
    could it be because Im using a child theme and it can’t find the function in the parent theme or something?


    shanebp
    Moderator

    @shanebp

    I think bp_has_forum_topics() only works on BP pages.
    Try bbp_has_topics()


    boriskamp1991
    Participant

    @boriskamp1991

    Could be @Shanebp !
    I cannot find any docs on this function, do you have a link? didn’t even knew it existed, where are docs around this and similar functions?

    Thanks!


    shanebp
    Moderator

    @shanebp

    bp = BuddyPress
    bbp = bbPress


    danbp
    Moderator

    @danbp

    Commented BuddyPress code can be found here for bp_has_forum_topics

    bp_has_forum_topics

    and here for bbp_has_topics

    bbp_has_topics


    boriskamp1991
    Participant

    @boriskamp1991

    Thanks guys! got it working now!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] bp_has_forum_topics() returns empty’ is closed to new replies.
Skip to toolbar