WordPress.org

Ready to get started?Download WordPress

Forums

Loop of Pages (4 posts)

  1. shacker
    Member
    Posted 6 years ago #

    I'm working on a small-ish site that will be all Pages, no Posts (because I need to preserve a structure of simple URLs, e.g. domain.com/software).

    I thought it would be a simple matter to tweak the loop to list 20 pages at a time, but it's not turning out that way. I've tried two methods:

    1) Use query_posts before the loop to retrieve pages rather than posts. But I can't see any argument options in the codex that will achieve a simple list of pages.

    2) Use list_pages() in the index rather than the loop. This sort of works, but I need to to display the Page body on the index. I can get the linked Page titles, but can't see any argument to list_pages() that will let me also display the Page body under each link.

    Basically I just want a loop of Pages that works otherwise like a normal loop. Is there any way to accomplish this? Thanks.

  2. Ivovic
    Member
    Posted 6 years ago #

    None that I know of.

    Is your only problem with posts the fact that you can't set permalinks to to category archives which don't have "/something/category" in them?

    If so, then I think you're better off looking into hacking the part of wordpress core code which requires that extra parameter before the category name.

    That sounds like a simpler hack than making this work.

  3. moshu
    Member
    Posted 6 years ago #

    If so, then I think you're better off looking into hacking the part of wordpress core code which requires that extra parameter before the category name.

    A lot of people tried that already... and they always come back complaining that something got broken in their blog.
    You were warned.

    to the OP: If I understand it correctly you are asking whether a "multi-Page" view is possible on WP (as we can have multipost view on index, archives etc.).
    As Ivovic stated - there isn't.

  4. shacker
    Member
    Posted 6 years ago #

    Hmm... thanks both.

    Is your only problem with posts the fact that you can't set permalinks to to category archives which don't have "/something/category" in them?

    That's similar to another thing I just tried - using a custom URL structure that includes only the postname, no date. The index display worked, but the links were all 404 (yes I updated .htaccess). Looks like this is covered here and is known not to work.

    Disappointing. Yes, preserving existing URLs of a currently static site is the main goal here. If only list_pages() had an optional arg to display the post body. Looked around for a plugin to do this, but didn't immediately see anything (though I didn't look very hard).

    Seems like there's got to be a way... but maybe not. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags