You are here:  » SiteURL Missing from Title


SiteURL Missing from Title

Submitted by allanch on Mon, 2016-12-19 10:53 in

Hi David,

I hope you're well. For the title in search result pages I seem to be missing the Site URL from the end of the format below.

ProductName | priceAsc | Shopping | SiteURL

Also the Shopping bit seems to have two extra spaces in front. I did a modification as described in node 205 but that has no effect whether there or not. I have also disabled the Yoast plugin that I thought may interfere with this. Do you know what may be causing the SiteURL to be missing and how I can get it back? Thanks.

Submitted by support on Mon, 2016-12-19 11:58

Hi Allan,

I'm going to look closely at how the title generation interacts with popular SEO plugins as part of the next version development, in the mean time, it looks as if the page title is not coming into the title hook on product pages, so can you insert it unconditionally. To do this, edit the plugin file pto.php and look for the following code at line 290:

    $content = $title." | ".($content?$content:(isset($post)?$post->post_title." | ":"").get_bloginfo("name"));

...and REPLACE with:

    $content = $title." | ".($content?$content:(isset($post)?$post->post_title." | ":"").get_bloginfo("name"));
    $content .= get_bloginfo("name");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by allanch on Mon, 2016-12-19 14:01

Thanks David,

I must have a older release which has at line 290:

$content = $title." | ".$content;

which I replaced with the above and all working.

Have a Merry Xmas and Happy New Year!