You are here:  » Pass term in to search title

Active Forum Topics

Pass term in to search title

Submitted by Andrew1 on Mon, 2018-03-05 11:42 in


Is it possible to pass the search term in to the title of the search page and main heading.

So instead of just 'shop'. Search results for 'keywords'.

I had achieved this on the standalone, but I can't see how to this in the WP version.

Many thanks

Submitted by support on Mon, 2018-03-05 12:27

Hi Andrew,

Version 3 (BETA) should be setting the header <title> however is not overriding the container page title but this can be done easily - edit the plugin file pto.php and look for the following code at line 638:

        $title = htmlentities($pto_q,ENT_QUOTES,get_option("blog_charset"));

...and REPLACE with:

        $title = htmlentities($pto_q,ENT_QUOTES,get_option("blog_charset"));
        $title_override = TRUE;

Hope this helps!


Submitted by Andrew1 on Mon, 2018-03-05 17:18

Thanks David. That works perfectly.

Submitted by Perce2 on Sun, 2018-03-18 11:12

I would like to do the same, but applying the mod doesn't seem to make any difference, all I get is the same page title for every search - "Shopping".

Similarly for Merchant, Category, Brand, the chosen item is never displayed as the title, just "Shopping".

Could this be because of the theme I run, I remember issues with getting the product title to show correct ?

Submitted by support on Mon, 2018-03-19 09:08


Yes it's almost certainly the same issue - if you could email me pto.php from this installation after applying the mod I'll check it out further with you...