WordPress.org

Ready to get started?Download WordPress

Forums

Theme not showing short codes (2 posts)

  1. jpearson
    Member
    Posted 1 year ago #

    Hey guys

    I'm finding that the theme I have built is not displaying the shortcodes for any plugins. I checked if they work in the default Twenty Eleven theme, and there's no problem there. I've been looking through the forums and found some posts that give me an indication of the problem, but I'm not quite sure how to implement it.

    I did find this string (at WordPress Shortcode Not Working) apply_filters('the_content',$single_page['post_content']), but I'm not seeing any output yet. I'm wondering if anyone can give me some suggestions as to what I'm doing wrong. (It's been a while since I developed a theme)

    The site is colswoodencreations.com.au. The code snippet is:

    <?php elseif( is_page(array(25, 33)) ) : ?>
        <div class="post">
            <?php echo apply_filters('the_content',$single_page['post_content']); ?>
        </div>
    <?php else : ?>
  2. justingreerbbi
    Member
    Posted 1 year ago #

    It is not being filtered by wordpress so it does not know to render shortcode

    Just try to render the content with the_content() make sure not to use get_the_content() as it will not filter the content and shortcodes will not work

Topic Closed

This topic has been closed to new replies.

About this Topic