/

CM Ad-Changer (CMAC) - Getting Started - Inserting Shortcode to the Theme Template


Inserting Shortcode in the Theme Template

Back to User Guides

Use the following PHP code to add a shortcode running your campaign anywhere in your template: do_shortcode( '[cm_ad_changer campaign_id="1"]' );

A reference is available here: https://developer.wordpress.org/reference/functions/do_shortcode/

To insert the shortcode into a template, use the following PHP code:

<?php echo do_shortcode( '[cm_ad_changer campaign_id="1"]' ); ?>

You can also use the following filter:

$ads_content = '[cm_ad_changer campaign_id="1"]';

$ads_content = apply_filters('the_content', $ads_content );

echo $ads_content;


More information about the CM Ad Changer WordPress  Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center