You are here:  » Setting Title & Description on Wordpress


Setting Title & Description on Wordpress

Submitted by kaqfa on Thu, 2017-12-14 03:44 in

Hello David,
I am trying to set the SEO and using the Yoast SEO plugin.
Every time the plugin is activated, all product come with title "Shopping-site name", not the product title.
However, when I try to deactivated, everything is normal.
How to change it?

Submitted by support on Thu, 2017-12-14 06:51

Hi and welcome to the forum!

Yoast SEO exposes its own title hook so a filter can be added to this in addition to the default WordPress title hook. To do this, edit pto.php and look for the following code at line 1017:

add_filter('wp_title','pto_title');

...and REPLACE with:

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

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by kaqfa on Mon, 2017-12-18 03:26

Hello David,
thanks for your reply

Finally succeeded setting the SEO part. I still have many question regarding to develop my site :

1. I want to show the Normal price and discounted price on product page. Is it possible to add new field "Normal Price" and display it?

2. How to make a grid style to view list of products likethis :
{link saved}

Thanks,
Happy Coding

Kaqfa

Submitted by support on Mon, 2017-12-18 10:35

Hello Kaqfa,

> 1. I want to show the Normal price and discounted price on product page.
> Is it possible to add new field "Normal Price" and display it?

Please see the following page for instructions for adding a custom field to your site;

https://www.pricetapestry.com/node/3094

However, rather than adding the field as VARCHAR(255), if the field is to hold a price value use a DECIMAL type instead, so to add the field `normal_price`, use the following dbmod.php script:

<?php
  
require("includes/common.php");
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."feeds`
            ADD `field_keywords` VARCHAR(255) NOT NULL default ''"
;
  
database_queryModify($sql,$result);
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products`
            ADD `normal_price` DECIMAL(10,2) NOT NULL default ''"
;
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

What I would also suggest is to decimalise the value in the same way as the normal price field (this handles situation where other text e.g. a currency symbol appears in the price). To do this edit, edit the standalone Price Tapestry file includes/admin.php and look for the following code at line 466:

    $importRecord["price"] = tapestry_decimalise($importRecord["price"]);

...and REPLACE with:

    $importRecord["price"] = tapestry_decimalise($importRecord["price"]);
    $importRecord["normal_price"] = tapestry_decimalise($importRecord["normal_price"]);

The Product / Main and Prices / Each templates support the %DB_fieldname% place holders so to display the normal price; use this in conjunction with the currency HTML as required, for example;

&pound;%DB_normal_price%

> 2. How to make a grid style to view list of products like this :

Sure - the Featured Products templates can can basically be used as a starting point for a grid layout - have a go with the following (wp-admin > Settings > PriceTapestry.org > Templates)

Prices / Before:

<div class='pto_row pto_fp'>

Prices / Each:

<div class='pto_col-s-10 pto_col-m-5'>
<p><a href='%PRODUCT_URL%'>%PRODUCT_NAME%</a></p>
%IF_IMAGE%
  <p><a href='%PRODUCT_URL%'><img src='%IMAGE_URL%' /></a></p>
%ELSE_IMAGE%
%ENDIF_IMAGE%
<p>
%IF_COMPARED%
  <em>from</em> %PRICE%
  <br />
  <a href='%PRODUCT_URL%'>Compare Prices</a>
%ELSE_COMPARED%
  %PRICE%
  <br />
  <a href='%PRODUCT_URL%'>More Information</a>
%ENDIF_COMPARED%
</p>
</div>

Price / After:

</div>

Cheers,
David.
--
PriceTapestry.com