You are here:  » meta description keywords wordpress seo

Support Forum



meta description keywords wordpress seo

Submitted by michael on Wed, 2012-07-25 19:56 in

Hi again david sorry to bother you again but ive set up extra meta_description and meta_keywords in my config and products table and added them to price tapestry no problems but i cant find how to get the meta's in place on wordpress for the products
ive tried altering line 234 of pto.php replacing $description with $product->meta_description but all i get is an empty value
i also added global $pto_config_databaseTablePrefix; to the top of the function but no luck

i had a look around but couldn't find a post that wanted the product database fileds as meta so its done automatically on feed import

for your reference i have the fields meta_keywords and meta_description in my product table

king regards

Michael

Submitted by support on Thu, 2012-07-26 08:45

Hi Michael,

First look for the following code beginning at line 389:

      $sql = "SELECT name FROM `".$pto_config_databaseTablePrefix."products` WHERE normalised_name='".$wpdb->escape($pto_product)."' LIMIT 1";
      if ($wpdb->query($sql))
      {
        $pto_productName = $wpdb->last_result[0]->name;
      }

...and REPLACE with:

      $sql = "SELECT name,meta_keywords,meta_description FROM `".$pto_config_databaseTablePrefix."products` WHERE normalised_name='".$wpdb->escape($pto_product)."' LIMIT 1";
      if ($wpdb->query($sql))
      {
        $pto_productName = $wpdb->last_result[0]->name;
        global $pto_productMetaKeywords;
        global $pto_productMetaDescription;
        $pto_productMetaKeywords = $wpdb->last_result[0]->meta_keywords;
        $pto_productMetaDescription = $wpdb->last_result[0]->meta_description;
      }

And then look for the following code at line 228 (the point at which you have already identified for being responsible for the meta tags)...

      $description = trim($description);

...and REPLACE with:

      global $pto_productMetaKeywords;
      global $pto_productMetaDescription;
      $keywords = $pto_productMetaKeywords;
      $description = $pto_productMetaDescription;

Cheers,
David.
--
PriceTapestry.com

Submitted by michael on Thu, 2012-07-26 13:42

Thanks David that got it sorted on another note is there a way to run the meta_keywords and meta_desription through the filter the title and description go through to correct all the &#32 for spaces.

also that may not matter as im going to have to edit some of the xmls with xslt as theres information that needs replacing in the xmls we are using

Best Regards
Michael

Submitted by support on Thu, 2012-07-26 13:57

Hi Michael,

Both global and per-feed filters can be applied to custom fields so you should see them as an option in the Field drop-down when adding filters...

Cheers,
David.
--
PriceTapestry.com