Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show Parent Title of Parent Forum

  • @quentinpotgieter

    Participant

    Hi, Thank you in advance. I always do a lot of research coming up with a solution before finally asking here.

    I have Home » Forums » Classifieds » Air Sports » Topic name – Breadcrumb

    I am able to output the parent title using bbp_forum_title(); which shows Air Sports

    I need to output the Parent of that so it shows Classifieds

    How can I do that with something short like <div id="<?php bbp_forum_title(); ?>">?

    I will wait for your response this time, I believe it would only be later tonight (Eastern Africa Time)

Viewing 4 replies - 1 through 4 (of 4 total)
  • @quentinpotgieter

    Participant

    Hi, any suggestions?

    @robkk

    Moderator

    something like this might work

    get_the_title( $post->post_parent );

    @quentinpotgieter

    Participant

    Thank you, that still only result in Air Sports

    @quentinpotgieter

    Participant

    Okay great, so all I really had to do is declare the variables first. So in future for everybody else, here is my solution:

    <?php //parent variables
    	$parent = get_post($post->post_parent);
    	$parent_title = get_the_title($parent);
    	$grandparent = $parent->post_parent;
    	$grandparent_title = get_the_title($grandparent);?>
    <div id="a-<?php echo $grandparent_title; ?>">

    Thank you very much Rob for your guidance.

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