WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content by Country (by iControlWP)
[resolved] Header (3 posts)

  1. nickth
    Member
    Posted 1 year ago #

    I can't get it to work in the header.php file. I tried the advice here http://stephanieleary.com/2010/02/using-shortcodes-everywhere/
    and put:
    <?php do_shortcode('[CBC country="us" show="y"]USA[/CBC]'); ?>

    which printed nothing.

    I also tried many other variations.

    What do I need to do to make it work?

    http://wordpress.org/extend/plugins/custom-content-by-country/

  2. nickth
    Member
    Posted 1 year ago #

    This worked:
    in functions.php
    add_filter( 'widget_text', 'do_shortcode' );

    Where I want it shown in a php file:
    <?php echo do_shortcode( '[CBC country="us" show="y"]USA[/CBC]' ); ?>

    Credit:
    http://thomasgriffinmedia.com/blog/2010/12/how-to-execute-wordpress-shortcode-in-widgets-and-template-files/

  3. nickth
    Member
    Posted 1 year ago #

    Resolved

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags