You are here:  » limit text


limit text

Submitted by gahanpip on Thu, 2018-10-25 06:29 in

Hello David

How can I limit text as with https://www.pricetapestry.com/node/6056 but in the WordPress plugin

Philip

Submitted by support on Thu, 2018-10-25 10:54

Hello Philip,

To do the same in the plugin, edit pto_product.php and look for the following code at line 436:

      $html_product = str_replace("%IF_DESCRIPTION%","",$html_product);

...and REPLACE with:

      $limit = 1000;
      if (strlen($product->description) > $limit)
      {
        $product->description = pto_common_substr($product->description,$limit)." <a href='".pto_common_buyURL($product)."'>More...</a>";
      }
      $html_product = str_replace("%DESCRIPTION%",$product->description,$html_product);

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by gahanpip on Thu, 2018-10-25 21:26

thank you