Help on calling shortcodes

Discussion in 'PHP' started by Boris_Badenoff, Apr 27, 2013.

  1. #1
    I am using a plugin that creates post via shortcodes. I want to call one of the shortcodes in my main index template. I am trying to call like this:
    <?php echo do_shortcode('[SalePrice]'); ?></p>
    but it doesn't seem to work. Can you share any experience you might have on this?
     
    Boris_Badenoff, Apr 27, 2013 IP
  2. merlin77

    merlin77 Active Member

    Messages:
    54
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    78
    #2
    Could be the shortcode is not being interpreted by wordpress. Try this and see what you get -

    <?php echo apply_filters( 'the_content',' [SalePrice] '); ?>
     
    merlin77, Apr 27, 2013 IP