my page titles are too long

Is this code adding the Velocity Websites to my page title?

my page titles are too long

Is this code adding the Velocity Websites to my page title?

Hi,
No, it’s in wp-content\themes\pro\framework\functions\frontend\meta.php. The function that is adding it is x_wp_title
If you would like to remove it, you can override it by adding the code below in your child theme’s functions.php file.
function x_wp_title( $title ) {
if ( is_front_page() ) {
return get_bloginfo( 'name' );
} elseif ( is_feed() ) {
return ' | RSS Feed';
} else {
return trim( $title ) . ' | ' . get_bloginfo( 'name' );
}
}
add_filter( 'wp_title', 'x_wp_title' );
Hope that helps
I got code in my header

Hello @VelocityWeb,
You will need to add this code in your child theme’s functions.php file and not in your header.
By the way, have you check Settings > General > Site Title? The titles were taken from this settings. If you have an SEO plugin, it must be check also because SEO plugins will modify the page titles.
Hope this helps.
I did just in the wrong section. I put it above additional functions and it the code has gone. Thanks 
You’re welcome.
Just got this- Why has not changed?


Hi,
I check your site and I can see that it is not working.
There is something else preventing it from working in your end.
Can you provide us the following information so we can take a closer look.
Set it as Secure Note
Thanks
ok have done that. Does this code work for pages as well as blog post. Both are adding site name and making the titles too long.
Hi @VelocityWeb,
It’s applicable for all pages but if you wish to alter the format of page title (<title></title>) I recommend any SEO plugin. Example the SEO Yoast plugin. The theme only displays the content provided by Wordpress.
It’s easier than a custom code which is static to that format.
Thanks!
I use yoast but MOZ is not picking up my yoast title and is picling up the wordpress one
Hey @VelocityWeb,
We cannot check your functions.php file because there is no ftp access given.
Please use this code instead:
function x_wp_title( $title ) {
if ( is_front_page() ) {
return get_bloginfo( 'name' );
} elseif ( is_feed() ) {
return ' | RSS Feed';
} else {
return trim( $title );
}
}
We should see if it works when the site name will be removed.
getting this error from yoast xml

Hey There,
Where did you see that error message? I went through your SEO Yoast settings but I couldn’t find it.
Could you please provide us with your FTP account as well since we can’t check the functions.php file through WordPress File Editor?
Many thanks.
Oh I solved it. There was a couple of blank lines at the end. 
Hey @VelocityWeb,
We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!
Best Regards.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.