Shortcode use in php echo section
-
Hi
Any help gratefully received, I’d like to use the shortcode
[cm_ad_changer campaign_id="1"]
in a echo section in my header.php file.I’ve tried all sorts of combinations but can’t get it to work
<?php echo do_shortcode(‘[cm_ad_changer campaign_id=”1″]’); ?>
‘<?php echo do_shortcode(‘[cm_ad_changer campaign_id=”1″]’); ?>’
<?php echo do_shortcode(“[cm_ad_changer campaign_id=”1″]”); ?>
‘echo do_shortcode(‘[cm_ad_changer campaign_id=”1″]’)’;Here is the code snippet with the shortcode insertion attempt.
if ( is_home() or is_front_page()) {echo '<div class="section group"> <div class="col span_1_of_2"> <a href="http://www.ptmagazine.co.uk/testsite/"><img src="http://www.ptmagazine.co.uk/testsite/wp-content/uploads/2013/12/PT-Magazine-Web-Logo.jpg"></a> </div> <div class="col span_1_of_2"> '<?php echo do_shortcode("[cm_ad_changer campaign_id="1"]");?>' </div> </div> </div> </div>' ; }
Thanks in advance
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Shortcode use in php echo section’ is closed to new replies.