Why does the Loop ONLY work on one page? (4 posts)

  1. Kyle Jennings
    Posted 6 years ago #

    So basically, I want to have the loop on more than one page, so that way I can filter my posts differently for different pages.

    BUT it seems like the loop only works on the posts page. Is there anyway to have the loop on multiple pages? If I cant do this, Im going to have to change index.php to some lengthy if/else statement which calls different templates for the filtering right?

  2. MichaelH
    Posted 6 years ago #

    You can use the a loop in something like page templates. See the Page of Posts example in the Pages article.

  3. Kyle Jennings
    Posted 6 years ago #

    so the inline posts plugin? that just display's specific posts right? I cant have the loop work? Im trying to run different queries on different pages

  4. MichaelH
    Posted 6 years ago #

    There's plugins that allow shortcodes in a page content that display posts.

    You can use a php code plugin to put a query/loop in a page or post content.

    You can put a query/post loop in a page template, in a sidebar.php, almost any template.

    Lots of examples:

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.