Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add page title and page blurb in any page of the forums


  • pepeng
    Member

    @pepeng

    <div id="sub_header">
    <?php
    /***
    * This conditional determines where exactly what page you are one.!
    **/
    if(is_home()){
    /* Blog Page */
    echo '<h1 class="page_title">';
    echo 'Welcome to my Blog';
    echo '</h1>';
    echo '<h2 class="page_blurb">';
    echo ' just another wordpress site';
    echo '</h2>';
    }else if(is_front_page()){
    /* Landing Page */
    echo get_post_meta($post->ID, "Landing Header", true);
    }else{
    echo '<h1 class="page_title">';
    echo get_post_meta($post->ID, "page title", true);
    echo '</h1>';
    echo '<h2 class="page_blurb">';
    echo get_post_meta($post->ID, "page blurb", true);
    echo '</h2>';
    }
    ?>
    </div>

    This the default site of my bbpress forums:

    http://localhost/mysite/forums/

    And I try to make page for forum using the short code [bbp-topic-index] :

    this is the link:

    http://localhost/mysite/forum/

    and I try to edit this code above:

    }else if(is_page('forum')){
    /* Forum Page */
    echo '<h1 class="page_title">';
    echo 'Forum Support';
    echo '</h1>';
    echo '<h2 class="page_blurb">';
    echo 'Press community';
    echo '</h2>';

    and it works fine only in page (forum) http://localhost/mysite/forum/

    but when I click all the the content in the forums my Title and Blurb has gone.

    WHat I want to do is my sub header page title and page blurb will appear in any page in forums.

    ANYONE knows how to fix this or how to add code?

    I’m just a beginners in wordpress

    your reply is much appreciated,

    Thank’s

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

  • pepeng
    Member

    @pepeng

    NOTE: that is the code of my header.php

    Cheers,


    Jared Atchison
    Member

    @jaredatch

    There are several different things you can do.

    I would recommend inserting this information by using hooks that bbPress put in place. Unfortunately there is no “master list” of the available hooks, so you have to dig in bbPress and find the best one. It’s very do-able but will take some trial and error.

    Your other option would be to approach things like you are doing now. I would use bbPress conditionals instead of is_page(). Here are a few of the conditionals available:

    bbp_is_single_forum()
    bbp_is_single_topic()
    bbp_is_topic_edit()
    bbp_is_topic_merge()
    bbp_is_topic_split()
    bbp_is_single_reply()
    bbp_is_reply_edit()
    bbp_is_reply_edit()
    bbp_is_single_view()
    bbp_is_single_user_edit()
    bbp_is_single_user()
    bbp_is_user_home()
    bbp_is_subscriptions()
    bbp_is_favorites()
    bbp_is_topics_created()
    is_bbpress() (this is all of the above wrapped in one)


    pepeng
    Member

    @pepeng

    Tnx jaredatch I’ll try to edit my code


    pepeng
    Member

    @pepeng

    I found a simple solution I create a new header for every forum page just like this <?php include(“header-forum.php”); ?>

    Cheers,

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