Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The following loop is in a single.php template file. It works ok, but the shortcodes aren't rendered.
the loop:

<div id="circula-destaque">
      <?php if(have_posts()): while(have_posts()): the_post(); ?>
      <h2><?php the_title(); ?></h2>
      <?php ik_mostra(the_content()); ?>        
        <?php endwhile; endif; ?>
</div>

outputs:
Some text I put html works fine, but [shortcodes] aren't rendering, any sugestions?

edit: that ik_mostra() function is here:

function ik_mostra($secao) {
    if ($secao != NULL) :
    echo apply_filters('the_content', $secao);
    endif;
}

A way I tried to render it.

share|improve this question
1  
What does ik_mostra() function do? the_content() function doesn't return anything, so using it as another function param is a little bit strange, I guess. –  Krzysiek Dróżdż Jul 4 '13 at 12:54
    
oh, i'm sorry about that. editted –  user1576978 Jul 4 '13 at 12:59
    
OK, so as I've already said, the_content function does not return anything and it already should apply the_content filter, so you don't have to use your function at all ($secao will be null every time ;) ). Correct this part, check if it's working and then we will debug it further. –  Krzysiek Dróżdż Jul 4 '13 at 13:05
1  
You don't have to use apply_filters( 'the_content' on the_content( ). This is done by default inside the_content( ). –  Mike Madern Jul 4 '13 at 13:09
1  
what shortcodes? are you using plugins for any other shortcodes than the generic Wordpress ones? –  Michael Jul 4 '13 at 13:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.