You are here:  » Images in category pages

Active Forum Topics


Images in category pages

Submitted by Ride on Fri, 2017-06-23 14:45 in

Hi David,
I'm setting up a new site with PT + WP, I was wondering if would be possible to associate an image to each category/subcategory, so that when you open the category page you get a list or grid of images instead of just the name of the categories.
Thank you!

Submitted by support on Sat, 2017-06-24 07:10

Hello Ride and welcome to the forum!

Sure - what I would suggest would be to make use of the existing logos/ folder used for the merchant logos in the A-Z, and upload your category images with the prefix "category_" followed by the category name exactly as it appears in the hierarchy, and with the same extension as merchant logos (".img" by default) for example;

/pt/logos/category_Motoring.img
/pt/logos/category_Home and Garden.img
/pt/logos/category_Kitchen Appliances.img
/pt/logos/category_Garden Furniture.img
etc.

(assuming Price Tapestry installed in /pt/ sub-directory of WordPress installation)

And then edit the plugin file pto/pto_atoz.php and look for the following code beginning at line 150:

      else
      {
        $item = $row->$module;
      }

...and REPLACE with:

      elseif (($module=="category") && $pto_config_externalPath && file_exists($pto_config_externalPath."logos/category_".$row->$module.$pto_config_logoExtension))
      {
        $item = "<img border='0' src='".$pto_config_externalBaseHREF."logos/category_".str_replace(" ","%20",$row->$module).$pto_config_logoExtension."' />";
      }
      else
      {
        $item = $row->$module;
      }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com