Website: {link saved}
Google Search titles: {link saved}
I am a bit at a loss why my title descriptions in google are showing my recent posts for every Price Tapestry item.(see above google results) How does pt generate the meta description for each product when placed in wordpress or am I doing something completely wrong :)?
I currently have header exclusivity set to enabled.
Thanks again.
When I replace the above code as suggested and use %DESCRIPTION% placeholder within the Meta Description template, my website shows the following error message:
Fatal error: Call to a member function escape() on a non-object in /var/www/vhosts/shoppingcity.ch/httpdocs/wp-content/plugins/pto/pto.php on line 211
Sorry Ivo,
$wpdb needs to be declared global, I've corrected this in the code above by adding the following line to the top of the modification:
global $wpdb;
Cheers,
David.
--
PriceTapestry.com
Hi David
When I use the modified code, the error is gone, but the source code does not show any description at all.
Ah sorry about that - the following global is also required (added above)
global $pto_config_databaseTablePrefix;
Cheers,
David.
--
PriceTapestry.com
Hi David
Works perfect now - thanks. Is it possible to limit the meta description to the first 165 characters of the product description?
Cheers, Ivo
Hello Ivo,
Sure - on the last line of the modification, in place of:
$description = str_replace("%DESCRIPTION%",$productDescription,$description);
...use:
$description = str_replace("%DESCRIPTION%",pto_common_substr($productDescription,165),$description);
That will break cleanly on the first space after 165 characters...
Cheers,
David.
--
PriceTapestry.com
Hello David
i tried the same code but the description is emply
also at Price Tapestry plugin page there is not setting to set header exclusivity and also i dont use any seo plugin
Hello George,
The latest version no longer has the header exclusivity setting since additional hooks are used to enable compatibility with SEO plugins so this is no longer required.
To add support for %DESCRIPTION% in your Product / Meta Description template, in pto.php look for the following code at line 347:
$description = str_replace("%PRODUCT_NAME%",htmlspecialchars($pto_productResults[0]->name),$description);
...and REPLACE with:
$description = str_replace("%PRODUCT_NAME%",htmlspecialchars($pto_productResults[0]->name),$description);
$description = str_replace("%DESCRIPTION%",htmlspecialchars($pto_productResults[0]->description),$description);
Cheers,
David.
--
PriceTapestry.com
Using your code;
$description = str_replace("%PRODUCT_NAME%",htmlspecialchars($pto_productResults[0]->name),$description);
$description = str_replace("%DESCRIPTION%",htmlspecialchars($pto_productResults[0]->description),$description);
Is it still possible to limit the meta description to the first 165 characters of the product description again?
Hi,
Sorry for the disappearing posts I was having forum database issues yesterday - please try:
$description = str_replace("%PRODUCT_NAME%",htmlspecialchars($pto_productResults[0]->name),$description);
$description = str_replace("%DESCRIPTION%",htmlspecialchars($pto_productResults[0]->description),$description);
$description = pto_common_substr($description,165);
Cheers,
David.
--
PriceTapestry.com
Hi Fuzzy,
Everything looks fine on the page - canonical is correct and the meta description is the plugin generated "Price search results for [product name]", however I do see that your latest blog post titles are what is being used in this case - which do appear on the page and ultimately there is no way to actually control the description used by search engines.
However, if you wanted to pull the actual product description into the meta description tag you could do this as follows: In pto.php look for the following code at line 209:
$description = $pto_html_product_description;
...and REPLACE with:
global $wpdb;
global $pto_config_databaseTablePrefix;
$description = $pto_html_product_description;
$productDescription = "";
$sql = "SELECT description FROM `".$pto_config_databaseTablePrefix."products` WHERE name = '".$wpdb->escape($pto_productName)."' AND description <> '' LIMIT 1";
if ($wpdb->query($sql))
{
$productDescription = $wpdb->last_result[0]->description;
}
$description = str_replace("%DESCRIPTION%",$productDescription,$description);
With that in place, you can now use the %DESCRIPTION% placeholder within the Meta Description template (wp-admin > Settings > PriceTapestry.org)
Hope this helps!
Cheers,
David.
--
PriceTapestry.com