You are here:  » Shortcode


Shortcode

Submitted by rickdebruin on Sun, 2012-03-25 18:10 in

Hi David,

Maybe a strange question, but it could be very, very useful for me.
Is there a shortcode to display only the title of a rendered post, so I can paste it in some extra text at the bottom?

Regards and happy with your script!

Rick

Submitted by support on Mon, 2012-03-26 07:58

Hello Rick,

Thank you for your comments!

Could you perhaps give an example, maybe with reference to a product page on the demo installation for example this page and let me know which sub-section of the content you want to be able to extract and I'll work out the code for you...

Thanks!

David.
--
PriceTapestry.com

Submitted by rickdebruin on Mon, 2012-03-26 09:08

Hi David,

I would like to extract the text of the title "Panasonic TX-L24C3B" so I can make some spinned text that's somewhat relevant and unique underneath or above the product display.

Thank's

Rick

Submitted by support on Mon, 2012-03-26 09:48

Hi Rick,

Rather than within the post body (as a method would be required to limit your before / after text to product pages only), it's probably best to contain your before / after text within the plugin templates.

Text above the main product information block can be included in the existing Product / Main template (wp-admin > Settings > PriceTapestry.org > HTML) where the %PRODUCT_NAME% placeholder is supported (although not used in the default version).

Custom text to be displayed after the price comparison table could be added to Prices / After, however this doesn't support the %PRODUCT_NAME% placeholder. To add this, look for the following code at line 132 of pto_product.php:

  $html .= $pto_html_prices_after;

...and REPLACE with:

  $html .= $pto_html_prices_after;
  $html = str_replace("%PRODUCT_NAME%",$product->name,$html);

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by rickdebruin on Mon, 2012-03-26 10:22

Wow David, you are quick!!

Great thinking, thank you, works fine.