Forums

Shortscodes and Custom Themes (5 posts)

  1. agregoryvt
    Member
    Posted 2 years ago #

    I have a theme that I customized for my site. When I try to run a shortcode in the page/post content nothing happens. It only shows it as text. But when I run the shortcode directly in the php code it works. Is there something I have to enable in my theme to be able to run shortcodes from the post/page content?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Make sure that you use <?php the_content();?> or <?php the_excerpt();?>

  3. agregoryvt
    Member
    Posted 2 years ago #

    Thanks for the help!

    I created a separate function to get the content because the_content() doesn't return anything. Is there anything I need to do in my theme to enable the function?

  4. agregoryvt
    Member
    Posted 2 years ago #

    Nevermind I figured it out. It's because I wasn't in the loop correctly. Thanks again for your help!

  5. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    the_content() includes some formatting and parsing filters. If you're grabbing raw, unfiltered, content, this will explain why your shortcodes aren't being parsed.

Topic Closed

This topic has been closed to new replies.

About this Topic