That works for the opening shortcode. In my reading and my trial run though it does not work for the closing shortcode.
this is not working?
<?php do_shortcode('[emember_protected for=3-4-5] & [/emember_protected]'); ?>
Have not tried that I guess. Where would I put the content that goes in between? It is a membership plugin that hides content between the two shortcodes.
Nevermind, tested this and seems to work.
<?php do_shortcode('[emember_protected for=3-4-5] Content Here [/emember_protected]'); ?>
But….I need to add more PHP in this code and that does not work. Sorry do not know much about PHP. Can use any help you can offer though! Here is what I have now that does NOT work.
<?php echo do_shortcode('[emember_protected for=3-4-5] <a href="<?php echo get_post_meta( $post->ID, '_ct_text_4d60a199efcc8', true ); ?>"><img src="http://preparedcatholic.com/wp-content/uploads/2011/02/download_supporter.jpg" /></a> [/emember_protected]'); ?>
do not to use ‘echo’ within the code, keep it to strings and function that return strings.
the code is already in a php area, so you can’t use the php tag.
also, as the string started with a single quotation mark ‘ you must use double quotations marks ” in the codes within.
try:
<?php echo do_shortcode('[emember_protected for=3-4-5] <a href="' . get_post_meta( $post->ID,"_ct_text_4d60a199efcc8", true ) . '"><img src="http://preparedcatholic.com/wp-content/uploads/2011/02/download_supporter.jpg" /></a> [/emember_protected]'); ?>
Perfect! Thanks! Also, thanks for the quick lesson on PHP. Every little bit helps and am slowly learning.