WordPress.org

Ready to get started?Download WordPress

Forums

Loop for PAGES??? (4 posts)

  1. thomask
    Member
    Posted 7 years ago #

    I need to show category page with list of pages (not post) in that category (i got a plugin for asigning categories to pages), but i do not know how to do loop for pages.
    this does not work:
    if (have_posts()) : while (have_posts()) : the_post();

    and something like have_pages afaik does not exist

  2. MichaelH
    Member
    Posted 7 years ago #

    WordPress doesn't allow Categories for Pages.

    Are you using some kind of plugin?

  3. thomask
    Member
    Posted 7 years ago #

    yes I do, it simpy uses posts Categories (the same table structure). But it does has only function to show titles of pages from that category. But i guess it does not matter, it may be a question of how to show them for pages made in some month (archive) etc., the problem i got is about looping. The only function WP got for pages is probably wp_list_pages(), what is function to show links to pages, but not their excerpts.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    If you want to put a loop in a page template, you need to call query_posts() to select the posts that you want to loop through first.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags