WordPress.org

Ready to get started?Download WordPress

Forums

Unable to Edit Pages (2 posts)

  1. rusticated
    Member
    Posted 3 years ago #

    One of my page templates features two loops, one of which outputs the content of the page itself, and one which uses query_posts to pull in the children of that page. The page can be seen here:

    http://is.quotebox.org/sports/football/

    For some reason, the existence of this second loop makes the 'Edit Page' button disappear from the admin menu bar at the top of the page. Is there any reason for this, and anything I can do to get the Edit link back?

    The first loop, which outputs the contents of the page, can be seen here:

    http://pastebin.com/tUKbUA5Z

    And the second, which outputs a list of the children, can be seen here:

    http://pastebin.com/FkRfTKCK

  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Probably because you're using query_posts() incorrectly. From the Codex:

    It is meant for altering the main loop. For creating secondary loops, you should make a new instance of WP_Query and use that instead...

    You're invoking all manner of unintended consequences, one of which is probably that the conditional tags get screwed up, which then screws up the output of the edit_post_link() function.

    I would recommend using get_posts() for your secondary query, so that you don't stomp on your primary Loop.

Topic Closed

This topic has been closed to new replies.

About this Topic