Support » Themes and Templates » Loop – Better way to set

  • Hi,

    Every theme I have created, I use a individual loop for each archive (single.php, page.php, category.php…) This is the first time I’m thinking to use the function <?php get_template_part( ‘loop’, ‘index’ ); ?> to organize my code.

    To set only one loop is easy. The problem is when I need to call a different loop for each archive. Initially I thought about using the Conditional Tags, but I have no idea how to proceed.

    My loop was as follows:

    And so on, with is_archive, is_page, etc.. It worked. But is this the best way to organize loop.php?


Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Loop – Better way to set’ is closed to new replies.