• I added a shortcode to my blog and it works fine when viewing the single post. However, when I’m viewing posts in the category and it sows the content, its showing me he shortcode unparsed. Is there a way to have it working in that view as well?

Viewing 6 replies - 1 through 6 (of 6 total)
  • it could be that your category template is using the_excerpt() instead of the_content() (in the loop)

    http://codex.wordpress.org/Function_Reference/the_excerpt

    try to edit the category template and replace the_excerpt() with the_content()

    Thread Starter carlhussey

    (@carlhussey)

    I look in the category.php file and its loading this

    <?php echo get_the_content_with_formatting(); ?>

    get_the_content_with_formatting(); seems to be a custom function –
    you might be able to find this in functions.php of your theme.

    Thread Starter carlhussey

    (@carlhussey)

    Didn’t see that function in there :/

    without knowing anything about your theme, and if this might break the design, just one suggestion:

    try and replace:
    <?php echo get_the_content_with_formatting(); ?>
    with:
    <?php the_content(); ?>
    or with:
    <?php echo do_shortcode(get_the_content_with_formatting()); ?>

    Thread Starter carlhussey

    (@carlhussey)

    <?php the_content(); ?>

    That seemed to have worked, just not sure if there are going to be any issues down the road with it. I figured that tje “With Formatting” is there for some reason.

    It does what I need right now though, thanks for the help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Shortcode In Category View?’ is closed to new replies.