Potentially quick question using do_shortcode()…
-
Hello,
I’m not fairly knowledgeable with PHP, but hopefully somebody can help me with a little problem I’m having…
So, I’m trying to add a shortcode after each post (this is the WP Paypal Shopping cart plugin)
[wp_cart:PRODUCT-NAME:price:PRODUCT-PRICE:end]
.I’ve played around with the
<?php do_shortcode(); ?>
, which I believe is the right tool to use. So I simply add<?php do_shortcode('[wp_cart:PRODUCT-NAME:price:PRODUCT-PRICE:end]'); ?>
.In place of
PRODUCT-NAME
, I want to insert the title of the post/product,<?php the_title(); ?>
, and in place ofPRODUCT-PRICE
, the custom field<?php meta('price'); ?>
.Putting
<?php do_shortcode('[wp_cart:<?php the_title(); ?>:price:<?php meta('price'); ?>:end]'); ?>
isn’t working, which makes sense I think because I have a<?php
inside another<?php
. My “simple” question is how to get the values of<?php the_title(); ?>
and<?php meta('price'); ?>
inside the shortcode to work correctly, if this is possible.Sorry for rambling… Any help would be greatly appreciated! ??
- The topic ‘Potentially quick question using do_shortcode()…’ is closed to new replies.