Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi imbrox, thanks for opening this support topic! 🙂

    Suggestion – Forum archives title:
    To give your forum a more clean title, I’d suggest going to the SEO Settings Page. Within the Title Settings metabox, you can find “Prefixes” (third tab).
    Select the option within there, so your title will change, as per example below:

    From: Archivos: Foros | GamElegant
    To:   Foros | GamElegant

    Resolution – Incorrect title on topics:
    About the topics having the incorrect title, I believe your theme is built around bbPress? It’s rather beautiful :). I unfortunately believe this is the cause for that the topics take their root forum’s name as the title.

    To resolve this, I believe this snippet should help:

    add_action( 'template_redirect', 'my_the_seo_framework_id_overwrite' );
    /**
     * Changes the ID The SEO Framework handles in the current loop.
     * @action template_redirect We need the query variable post_type.
     */
    function my_the_seo_framework_id_overwrite() {
    
    	if ( is_admin() )
    		return;
    
    	if ( 'topic' === get_post_type() && function_exists( 'bbp_get_topic_id' ) )
    		add_filter( 'the_seo_framework_current_object_id', 'bbp_get_topic_id' );
    }

    If that doesn’t work, we can use this snippet instead:

    add_action( 'template_redirect', 'my_bbpress_title_overwrite' );
    /**
     * Changes bbPress topic title. Does nothing in admin.
     * @action template_redirect We need the query variable post_type.
     */
    function my_bbpress_title_overwrite() {
    
    	if ( is_admin() )
    		return;
    
    	if ( 'topic' === get_post_type() ) {
    		//* The SEO Framework Filter.
    		add_filter( 'the_seo_framework_pre_add_title', 'get_my_bbpress_title_overwrite' );
    
    		//* WordPress filters, when used you'll need to add your own additions.
    		// add_filter( 'pre_get_document_title', 'get_my_bbpress_title_overwrite', 10 );
    		// add_filter( 'wp_title', 'get_my_bbpress_title_overwrite', 9, 3 );
    	}
    }
    
    function get_my_bbpress_title_overwrite( $title = '' ) {
    
    	if ( function_exists( 'bbp_get_topic_title' ) )
    		return bbp_get_topic_title();
    
    	return $title;
    }

    You can place the snippet (one of them) in your child-theme’s functions.php file. To read more about using filters, please refer to this guide.

    I hope this helps! Please let me know which filter did the trick, as I then might use it as a permanent solution within The SEO Framework :).

    Have a great day!

    Thread Starter imborx

    (@imborx)

    I already fix the Forum archives title, thanks for that!.

    About the topics title, I try to place both snippets on my functions.php but nothing changed. Can I speak with you in private to give you my FTP credentials and check whats going on? Email to me please: contacto@gamelegant.com

    Best regards and thank you so much

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi imborx,

    I believe we’re encountering a (premium) theme conflict.

    You can contact me here so we can investigate the premium theme’s header code. Instructions will be provided from there.

    However, please do not share any credentials. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problems with bbpress titles’ is closed to new replies.