Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_get_forum_title is pulling the topic title instead


  • aravoth2011
    Participant

    @aravoth2011

    When I use bbp_get_forum_title to pull the forum title for display on the front page of my website, it pulls the topic title instead.

    The idea is to display the forum title like categories are displayed in wordpress.

    To do this I’m using breadcrumbs, so my code looks like..

    <?php $show_sep = false; ?>
    <?php if ( 'forum' == bbp_get_forum_post_type() ) : ?>
    <?php
    $breadcrumbs = '<a href="' . bbp_get_forum_permalink( $parent->ID ) . '">' . bbp_get_forum_title( $parent->ID ) . '</a>';
    if ( $breadcrumbs ) :
    ?>
    <span class="cat-links">
    <?php printf( __( '<span class="%1$s">Posted in</span> %2$s ' ),'', $breadcrumbs);
    $show_sep = true; ?>
    </span>
    <?php endif; // End if $breadcrumbs ?>

    It’s not working, it’s displaying the topic title instead. In fact I went through several variations of this, several of them not using breadcrumbs, but every time I would use bbp_get_forum_title, or bbp_get_topic_forum_title, and I just couldn’t get it to work.

    I’m wondering if there is something wrong with my code, or if anyone knows any other reason why bbp_get_forum_title would display the topic title instead.

    I really just started learning all this stuff recently, so I could really use a hint or two..

    Thanks for any help anyone can offer.

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

  • aravoth2011
    Participant

    @aravoth2011

    I have noticed that my permalink structure when viewing a forum topic looks like this http://test.website.com/topic/topic-title,

    could this have something to do with it? Shouldn’t the permalink look like..

    http://test.website.com/forum-title/topic-title ?

    Honestly I’m kinda baffled. even bbp_get_topic_forum_title only pulls the topic title.


    aravoth2011
    Participant

    @aravoth2011

    you can see an example of what I’m trying to pull off at http://test.objectsinmotion.org

    The area in question is the meta data for the post that is situated just below the featured slider. You’ll see an area that reads “posted in”. It should say “posted in General Discussion”, rather than “posted in whatever the topic title is”


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    You need to actually do your query loop, probably using bbp_has_posts()

    The if ‘forum’ == bit will always equal true, so you can remove it.


    Rescue Themes
    Participant

    @rescuethemes

    Really old thread but sharing my solution in case it’s helpful for anyone else. I used:

    <?php single_post_title(); ?>

    Instead of:

    bbp_get_forum_title

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘bbp_get_forum_title is pulling the topic title instead’ is closed to new replies.
Skip to toolbar