WordPress.org

Ready to get started?Download WordPress

Forums

Filter searched pages (7 posts)

  1. reloweb
    Member
    Posted 11 months ago #

    Hi,
    I've got a problem filtering pages by searching a keyword.
    I organized WordPress in this way: there are parent pages, in which I put “Hospitals”, and their child pages, in which I put “Wards”. I'd like to organize the search on the website separating “Hospitals” (parent pages) from “Wards” (child pages).
    Code that filters only parent pages is: http://pastebin.com/mNUSz9iV but it doesn't work...

  2. The Grey Parrots
    Member
    Posted 11 months ago #

    You may use this function
    http://codex.wordpress.org/Template_Tags/wp_list_categories

    where depth =1 to get top level categories.

  3. The Grey Parrots
    Member
    Posted 11 months ago #

  4. The Grey Parrots
    Member
    Posted 11 months ago #

    Sorry last post was not for you.

  5. reloweb
    Member
    Posted 11 months ago #

    Maybe I've explained my problem in wrong way. I've trouble creating the search.php page. I've got a form with a radio button (Hospitals and Wards are the value for the radio). If the user searches a keyword selecting "Hospital", WordPress have to search only in parent pages, if he selects "Wards", WordPress have to search only in child pages.

  6. The Grey Parrots
    Member
    Posted 11 months ago #

    Are you talking about something like this
    http://wordpress.org/plugins/list-category-posts/

  7. reloweb
    Member
    Posted 11 months ago #

    I've pages, not posts...

Reply

You must log in to post.

About this Topic