WordPress.org

Ready to get started?Download WordPress

Forums

Modify Queryposts to search for pages? (5 posts)

  1. jeremyduffy
    Member
    Posted 5 years ago #

    I'm trying to get query_posts to return page results instead of just posts. Is it possible?

  2. MichaelH
    Member
    Posted 5 years ago #

    Use the argument 'post_type=page'

  3. jeremyduffy
    Member
    Posted 5 years ago #

    I tried that, but there seems to be some kind of code that prevents pages from coming up with any options other than search terms. When I enter tags or categories, even if there are some assigned to a page, query_posts won't return them.

    I need to be able to search for pages with a combination of tags, categories, or search terms. That works fine for posts already, but even restricting it to page using what you showed doesn't seem to work :(

  4. MichaelH
    Member
    Posted 5 years ago #

  5. jeremyduffy
    Member
    Posted 5 years ago #

    I checked out search-everything, but it didn't seem to work. The search plugin I'm writing uses query_posts so if search-everything is supposed to modify that to work the way I need, then I'll have to give it more time and see what I can do.

Topic Closed

This topic has been closed to new replies.

About this Topic