Skip to:
Content
Pages
Categories
Search
Top
Bottom

Page titles in U-Design theme


  • corytrevor
    Participant

    @corytrevor

    Hi

    I’m running latest versions of everything (WP 3.6.1, BuddyPress 1.8.1, BBPress 2.4, U-Design 2.1.0). BBPress & Buddypress are the only active plugins.

    In U-Design the page titles don’t show for BuddyPress pages – http://nzwpsites.com/members/
    But they work fine for BBPress – http://nzwpsites.com/forums/forum/test-forum/

    Other themes like 2013 show the page titles fine so it seems to be a theme issue. Here is the code from the themes functions.php for the page titles:


    <div id="page-title">
    <?php if (is_page()) : ?>
    <h1><?php the_title(); ?></h1>
    <?php elseif ( is_single() ) : ?>
    <h1><?php the_title(); ?></h1>
    <?php elseif ( is_post_type_archive() ) : ?>
    <h1 class="pagetitle"><?php post_type_archive_title(); ?></h1>
    <?php elseif (is_tax()) : /* If this is a taxonomy archive */
    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
    <h1 class="pagetitle"><?php echo ucwords( $term->name); ?></h1>
    <?php elseif (is_category()) : /* If this is a category archive */ ?>
    <?php if ($udesign_options['show_archive_for_string'] == 'yes') : ?>
    <h1 class="pagetitle"><?php single_cat_title("", true); ?></h1>
    <?php else : ?>
    <h1 class="pagetitle"><?php printf( __('Archive for the %s Category', 'udesign' ), single_cat_title("", false) ); ?></h1>
    <?php endif; ?>
    <?php elseif (is_search()) : /* If this is a search results page */ ?>
    <h1 class="pagetitle"><?php printf( __('Search Results for %s', 'udesign' ), get_search_query() ); ?></h1>
    <?php elseif (is_404()) : /* If this is a 404 page */ ?>
    <h1 class="pagetitle"><?php esc_html_e('Page Not Found (Error 404)', 'udesign'); ?></h1>
    <?php elseif( is_tag() ) : /* If this is a tag archive */ ?>
    <h1 class="pagetitle"><?php printf( __('Posts Tagged %s', 'udesign' ), single_tag_title("", false) ); ?></h1>
    <?php elseif (is_day()) : /* If this is a daily archive */ ?>
    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_date() ); ?></h1>
    <?php elseif (is_month()) : /* If this is a monthly archive */ ?>
    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('F Y') ); ?></h1>
    <?php elseif (is_year()) : /* If this is a yearly archive */ ?>
    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('Y') ); ?></h1>
    <?php elseif (is_author()) : /* If this is an author archive */ ?>
    <h1 class="pagetitle"><?php esc_html_e('Author Archive', 'udesign'); ?></h1>
    <?php elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : /* If this is a paged archive */ ?>
    <h1 class="pagetitle"><?php esc_html_e('Blog Archives', 'udesign'); ?></h1>
    <?php else : // the case when a Title is NOT present the height should be maintained ?>
    <div class="no-title-present"></div>
    <?php endif; ?>
    </div>
    <!-- end page-title -->

    On the BuddyPress pages it is showing the “no-title-present” div in the source code so it doesn’t seem to be detecting a page title. Does anyone know of any reason why this might be happening or if there is any code that can be added to detect the BuddyPress page titles?

    Thanks for listening, any advice much appreciated

    Cheers

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

  • corytrevor
    Participant

    @corytrevor

    Update: The themes author was kind enough to provide the code to add to display the buddypress page titles. Add:

    <?php elseif ( function_exists('bp_is_page') && ( bp_is_page( BP_BLOGS_SLUG ) || bp_is_page( BP_FORUMS_SLUG ) || bp_is_page( BP_ACTIVITY_SLUG ) || bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() || bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) ) : ?>
    <h1><?php the_title(); ?></h1>

    to functions.php just below where it has:

    <?php if (is_page()) : ?>
    <h1><?php the_title(); ?></h1>


    bp-help
    Participant

    @bphelp

    @corytrevor
    You might want to shared with the theme author that bp_is_page() was depreciated as of BP 1.7+


    corytrevor
    Participant

    @corytrevor

    Hi @bphelp

    Thanks for pointing that out. Here is the new and improved solution:

    
    <?php elseif (  function_exists('bp_current_component') && ( bp_current_component() ) ) : ?>
            <h1><?php the_title(); ?></h1>
    

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page titles in U-Design theme’ is closed to new replies.
Skip to toolbar