Last active
August 29, 2015 14:18
-
-
Save amdrew/a8be1db4d11774418714 to your computer and use it in GitHub Desktop.
OptimizePress + AffiliateWP. Shows how to load a different shortcode for different pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function affwp_opi_add_tracking_shortcode() { | |
// this can be the page ID, page slug, or page title. Page title is shown below | |
if ( is_page( 'Your Success Page' ) ) { | |
echo do_shortcode( '[affiliate_conversion_script description="Your Description" amount="100"]' ); | |
} | |
// another "thanks" page using a page ID | |
if ( is_page( 50 ) ) { | |
echo do_shortcode( '[affiliate_conversion_script description="A different description" amount="200"]' ); | |
} | |
} | |
add_action( 'wp_head', 'affwp_opi_add_tracking_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment