You are here:  » Title on pages

Active Forum Topics


Title on pages

Submitted by wilkins on Fri, 2016-02-05 10:01 in

Hi David

Just started to test PT in a new site, works OK but the title for the pages are all the same see example below, wondering if I have missed anything on the install.

{link saved}

Brent

Submitted by support on Fri, 2016-02-05 11:32

Hello Brent,

The wp_title hook used for setting the title has been deprecated in WordPress 4.4 and some newer themes only use the new method so that should be all it is. I have updated this in the distribution, but if you would like to preserve any existing modifications you may have made you can patch pto.php as follows;

Look for the following code at line 195:

  function pto_title($content)

..and REPLACE with:

  function pto_title($content="")

Then look for the following code at line 290:

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

...and REPLACE with:

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

And finally look for the following code at line 614:

  add_filter('wp_title','pto_title');

...and REPLACE with:

  add_filter('wp_title','pto_title');
  add_filter('pre_get_document_title', 'pto_title');

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by wilkins on Fri, 2016-02-05 11:59

Hi david

that worked great, just noticed getting the title shopping on category and merchant pages, is this the same issue.

brent

{link saved}

Submitted by support on Fri, 2016-02-05 13:13

Hello Brent,

The container page title is actually pulled in intentionally by the above to replicate wp_title functionality but that can be removed easily. In the second replacement described above, where you now have:

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

...REPLACE with:

  $content = $title." | ".get_bloginfo("name");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by wilkins on Wed, 2016-02-10 08:32

Hi David , just tried this and I am getting an error

Parse error: syntax error, unexpected ')'

Any ideas.

Brent

Submitted by support on Wed, 2016-02-10 10:29

Hello Brent,

Sorry about that - there was a superfluous ")" in the replacement - corrected above.

Cheers,
David.
--
PriceTapestry.com

Submitted by wilkins on Mon, 2017-03-20 16:42

Hi David

Trying to move forward total integration with WordPress, there is just on thing with the page title see below.

It shows on the page the page title shopping, what I would like is to show the brand name (on merchant and category it also shows shopping, would like merchant and category title), on the product page it shows the product title.

{link saved}

Regards

Brent

Submitted by support on Mon, 2017-03-20 17:47

Hello Brent,

I know you've been using the script for a few years now, please could you email me the plugin file pto.php from this installation and I'll check that out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Thu, 2018-01-11 10:30

Hi David,

just come across this post with quite some interest. For ages now I've been struggling to get the product name to show in the page title bar on a theme that I use.
In previous versions of the theme it always worked, until some time back, they released an update and the product titles just vanished from the page.

Even if I mess around with the settings and get the product title to show on the page, it's not displaying where it should be. Other normal formed site pages show the title correctly located, it just seems to effect any pages generated by PTO.

Having now spent hours on this and with recent contact with the theme developer, it points to an issue with PTO. The problem is the same with PTO 2 and PTO 3 Beta.

I notice that there is code in the latest PTO 3 Beta that is now shown as "deprecated" causing quite a lot of error log's, could this be something to do why the product page titles don't show ?

Thanks.

Submitted by support on Thu, 2018-01-11 11:10

Hi,

I wasn't aware of any deprecated issues in beta 3 as I have been developing it against the latest versions of PHP - would it be possible to copy more of the deprecated warning showing the specifics from your log so I can check that out further?

Regarding the title, on the product pages are you just seeing the default container page title e.g. "Shopping"?

Thanks,
David.
--
PriceTapestry.com

Submitted by Perce2 on Thu, 2018-01-11 11:39

Followed up by email.

Thanks.