Viewing 1 replies (of 1 total)
  • Plugin Author Takahashi Fumiki

    (@takahashi_fumiki)

    Hi poopsplat.

    To use some template tags outside of the loop, you have to call setup_postdata.

    foreach ( get_posts() as $post ) :
        setup_postdata($post);
        // Here, everything is same as loop.
    endforeach;
    wp_reset_postdata(); // Fix global loop.
    
Viewing 1 replies (of 1 total)
  • The topic ‘Use outside of the loop’ is closed to new replies.