Title Output - SEO Framework Conflict

We are using the plugin SEO Framework but there is a conflict with the them, as the title is generated twice

Awards \| Sport, ESPY Awards, July, Los Angeles, USA \| Site Name Awards \| Sport, ESPY Awards, July, Los Angeles, USA

Could you please tell me where the theme outputs the title, so I can delete this reference?

You can view the original thread here:

many thanks,
Andrew

Hi Andrew,

Thanks for reaching out.

It’s probably related to this code

  function x_wp_title( $title ) {

    if ( is_front_page() ) {
      return get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'description' );
    } elseif ( is_feed() ) {
      return ' | RSS Feed';
    } else {
      return trim( $title ) . ' | ' . get_bloginfo( 'name' );
    }

  }
  add_filter( 'wp_title', 'x_wp_title' );

If you wish to disable that filter then please add this code to your child theme’s functions.php

  function x_wp_title( $title ) {

  }

But regardless, your SEO Framework should able to override it since the code only uses filter. And any filter can be overrides by changing its priorities. Which your SEO Framework should capable of.

Thanks!

Hello Rad,

I have tried your code but still it does nothing. Is there anything else you suggest trying?

Actually I found the problem to be in framework/functions/frontend/meta:

if ( ! function_exists( 'x_wp_title' ) ) :
  function x_wp_title( $title ) {

if ( is_front_page() ) {
  return get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'description' );
} elseif ( is_feed() ) {
  return ' | RSS Feed';
} else {
  return trim( $title ) . ' | ' . get_bloginfo( 'name' );
}

  }
  add_filter( 'wp_title', 'x_wp_title' );
endif;

However if I remove this I get an empty <title></title> string…

Hey @neodjandre,

If you remove that code, the default WordPress title output will be used and the theme no longer has any connection with the title. If the title element is empty, that means there’s something else overriding the title.

Still, with that function removed, switch to the parent theme (if you’re using a child theme) and deactivate all third-party plugins and check the title. If the title’s still empty. Please try re-installing WordPress.

Thanks.

ok sorry my fault, there was a duplication in the child theme eventually! thanks for the help, as I managed to locate the error with your assistance :wink:

Glad that we could be of help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.