You are here:  » Change head title different then product title

Active Forum Topics


Change head title different then product title

Submitted by cascadeclimbers on Wed, 2017-11-22 04:07 in

Hi David,

How do you make the head.title different then the one set in H1 product title in wp-admin? I've tried several modifications of the plugin code but can't seem to figure it out. I'd like the H1 Product Title to stay the same, but have the page title be something different. Thanks!

Submitted by support on Wed, 2017-11-22 10:25

Hi,

The head title is generated in pto.php by the pto_title() function - if you look for the following code at line 615:

      $title .= $pto_html_product_title;

...this is where the $title variable is initialised from the Product / Title template in admin. You'll notice that this is the same for the product and review pages using a drop through case statement;

    case "product";
    case "review";
      $title .= $pto_html_product_title;

...so you could override $pto_html_product_title for product pages only (leaving review head titles unchanged) by inserting the new template content after the product case, for example:

    case "product";
      $pto_html_product_title = "Find the best prices for %PRODUCT_NAME%";
    case "review";
      $title .= $pto_html_product_title;

Cheers,
David.
--
PriceTapestry.com