This topic has 23 replies, 4 voices, and was last updated 9 years by Andrei.

  • Author
  • #53370
     Reflect Growth
    Participant

    I’ve just spotted that the page titles for the Buddy Groups / Members / Activity and for bbPress’ Forums don’t seem to follow the convention provision for by the functions in the kleo theme. All other wordpress pages will either be:

    – Site Name | Description (for the homepage)
    – Page / Post Title | Site Name (for any other pages / posts)

    But the aforementioned pages only seem to generate:

    – Page Title | (with no Site Name being appended) – you can see this at: http://www.reflectgrowth.com/co-create/forums/ as an example or http://www.reflectgrowth.com/co-create/activity/

    I’m sure this was working when I configured the theme a couple of months ago. I do use the “Add Meta Tags” plugin – https://wordpress.org/plugins/add-meta-tags/ but do not use this to customise title tags, and have in fact deactivated this to ensure it does not affect this issue.

    Quoted from functions.php in Kleo Theme:

    COPY CODE
    if ( ! function_exists( '_wp_render_title_tag' ) ) {
        function kleo_slug_render_title() {
            ?>
            <title><?php wp_title( '|', true, 'right' ); ?></title>
            <?php
        }
        add_action( 'wp_head', 'kleo_slug_render_title' );
    }
    
    if (!function_exists('kleo_wp_title')):
    	/**
    	 * Creates a nicely formatted and more specific title element text
    	 * for output in head of document, based on current view.
    	 *
    	 * @since Kleo Framework 1.0
    	 *
    	 * @param string $title Default title text for current view.
    	 * @param string $sep Optional separator.
    	 * @return string Filtered title.
    	 */
    	function kleo_wp_title( $title, $sep )
    	{
    			global $paged, $page;
    
    			if ( is_feed() ) {
    					return $title;
    			}
    			// Add the site name.
    			$title .= get_bloginfo( 'name' );
    
    			// Add the site description for the home/front page.
    			$site_description = get_bloginfo( 'description', 'display' );
    			if ( $site_description && ( is_home() || is_front_page() ) ) {
    					$title = "$title $sep $site_description";
    			}
    			// Add a page number if necessary.
    			if ( $paged >= 2 || $page >= 2 ) {
    					$title = "$title $sep " . sprintf( __( 'Page %s', 'kleo_framework' ), max( $paged, $page ) );
    			}
    
    			return $title;
    	}
        if ( ! function_exists( '_wp_render_title_tag' ) ) {
            add_filter('wp_title', 'kleo_wp_title', 10, 2);
        }
    endif;

    Any thoughts why this might be happening?

    #53371
     Reflect Growth
    Participant
    This reply has been set as private.
    #53793
     Brunoexpress
    Participant

    Hi,

    I’ve got exactly the same issue. I don’t know if it had ever worked though. I installed BuddyPress only 2 weeks ago.

    Have you found a solution?

    #53985
     Reflect Growth
    Participant

    Looking at the demo sites at: http://seventhqueen.com/themes/kleo/activity/

    It seems that it is meant to work, but for some reason its not for BuddyPress & bbPress.

    Support – Can you guys shed any light on this at all?

    My next steps are to disable all plugins and re-test, to ensure its not a plugin affecting this.

    #54549
     Reflect Growth
    Participant

    I’ve done a disable of all plugins with the exception of bbpress & buddy press and even swapped themes the problem still persists!

    So this look like a buddypress & bbpress issue? Might be that there is an action / filter that needs to be implemented to format page titles for buddypress & bbpress specifically?

    @Support – How did you guys achieve this for your demo site?

    #54550
     Reflect Growth
    Participant

    These couple of links seem to suggest a filter that might work – I’ll try and have a go at this next:

    https://buddypress.org/support/topic/editing-group-and-forum-page-title-tags/
    https://buddypress.org/support/topic/how-to-edit-title-tags/

    I reckon bp_modify_page_title is the filter worth looking at! I’ll update when I get 5 🙂

    #54649
     Andrei
    Moderator

    This issue is in the most cases created by the Yoast Seo plugin, which has an old, known, incompatibility with buddypress. Here is a topic in which I’ve given a fix to the issue, please let me know if it works in your case also:

    https://archived.seventhqueen.com/forums/topic/title-tags-for-groups-members-are-missing

    Looking forward.
    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #55014
     Reflect Growth
    Participant

    Thanks Andrei, I did take a look but I think that may be specific to the plugin you mentioned. Unless I’m missing something?

    I’ve tried using the ‘bp_modify_page_title’ filter which works for changing the page title for Buddypress pages successfully. The same issue exists for bbPress pages, so I’m now hunting for a similar filter I can use for those pages too.

    COPY CODE
    /* BuddyPress & bbPress: Page Title fix */
    add_filter( 'bp_modify_page_title', 'my_page_title', 10); // Works for BP pages fine :)
    add_filter('bb_title', 'my_page_title'); // Doesn't work for BB pages :(
    function my_page_title( $title) {
        
        return $title.' Reflect Growth'; // TODO: Change to dynamic WP func call.
    }

    As an aside, I’m wondering if this issue cropped up when WordPress 4.1 introduced the theme support for page titles? Can’t substantiate that one though, just a little puzzled as I’m sure this was working fine.

    #56370
     Andrei
    Moderator

    Hi,

    This incompatibility between yoast-seo and buddypress/bbpress is older than wp 4.1 and the new title tags support.
    I hope that with the new title tag support all plugins will align to the new standards and make everyone life easier.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #56552
     bradh
    Participant

    I am encountering this problem but do not have the Yoast (or any) SEO plugin. Any idea what this could be?

    #56554
     bradh
    Participant

    I should note that I am only having issues with bbPress.

    #57008
     bradh
    Participant

    An response to this thread would be most appreciated — the issue I have presented is limited to bbPress and I would like to correct the SEO of my website.

    #57071
     bradh
    Participant

    Reflect Growth, the following code will correct your issue for bbPress pages…

    COPY CODE
    /* BuddyPress & bbPress: Page Title fix */
    add_filter( 'bp_modify_page_title', 'my_page_title', 10); // Works for BP pages fine :)
    add_filter('bb_title', 'my_page_title'); // Doesn't work for BB pages :(
    function my_page_title( $title) {
        
        return $title.' Reflect Growth'; // TODO: Change to dynamic WP func call.
    }
    #57072
     bradh
    Participant

    Sorry, correction listed below…

    COPY CODE
    /* BuddyPress & bbPress: Page Title fix */
    add_filter( 'bp_modify_page_title', 'my_page_title', 10); // Works for BP pages fine :)
    add_filter('bbp_title', 'my_page_title'); // Doesn't work for BB pages :(
    function my_page_title( $title) {
        
        return $title.' Reflect Growth'; // TODO: Change to dynamic WP func call.
    }
    #57074
     bradh
    Participant

    Reflect Growth, the following code is an update to your fix that includes a dynamic call…

    COPY CODE
    /* BuddyPress & bbPress: Page Title fix */
    add_filter( 'bp_modify_page_title', 'my_page_title', 10);
    add_filter('bbp_title', 'my_page_title');
    function my_page_title( $title) {
        return $title.' ' .get_bloginfo( 'name', 'display' );
    }
    #57092
     Reflect Growth
    Participant

    @bradh – thank you mate! You’re a legend. Can’t believe that I was just one character off with the filter name – doh!!


    @Andrei
    – Just to clarify I’m not using the Yoast plugin. The above filter’s correct the behaviour I was seeing 🙂

    Once again big thanks to @bradh! Tried, tested & working like a charm!

    #57551
     Reflect Growth
    Participant

    Just updating this thread to “Unresolved” as the fix does not apply to forums in bbPress. It seems that if you navigate to a topic the fix works, but if you look at the page title for a forum just a list of tags is shown for the page title.

    Any thoughts on this aspect of the issue? @bradh / @Andrei

    I’ll investigate this further shortly.

    #57599
     Andrei
    Moderator

    Can you please post a list with the plugins that you’re using ?
    Looking forward.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #57667
     Reflect Growth
    Participant
    This reply has been set as private.
    #57919
     Andrei
    Moderator

    I don’t manage to think of anything from that list that might cause issue, probably the code that you’re applied for fixing buddypress titles has made another problems with bbpress. We’re planning an update around the middle of this month so I’ll put this issue on our testing list to be sure everything will work just fine.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #57923
     Reflect Growth
    Participant

    Thanks @Andrei I will update the thread if I find anything further myself. It feels as though it may just be another filter that needs to be applied for forum page titles specifically, but that seems a bit over the top.

    I’m certain this was all working fine initially, as the historic google indexes were showing the right page titles. Sounds like something has snuck in under the radar.

    Would be worth flagging the WordPress change re: page title support in case that has in some way affected the theme to 🙂 This article outlines the change introduced in WordPress 4.1:

    http://wptavern.com/wordpress-4-1-to-introduce-theme-support-for-the-title-tag

    #57927
     Andrei
    Moderator

    We already integrated this and worked without problem. The issue mainly comes from additional plugins, but as I’ve said, we’ll give it a test on a fresh install and see if everything works as it should or if is something to be fixed from our side.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #57928
     Reflect Growth
    Participant

    @Andrei my apologies I didn’t know you’d already tested with that change 🙂 Thanks for your help.

    #57932
     Andrei
    Moderator

    No problem, I’m glad I could help you with some infos.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 24 posts - 1 through 24 (of 24 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?