Forums

Auto Redirecting from search box on parent page to child pages (8 posts)

  1. TOPGUNN
    Member
    Posted 8 months ago #

    Im new to WP and website building.

    I was wondering how I could create a parent page with a search box and when you enter a search item into the searchbox and click submit that it would direct you to the item page within my website.

    Say I have a site about college reviews. I would like the user to be able to type in a certain college and click submit and it would redirect that user to that colleges page in my website.

    I would also like for the child pages to be hidden, not seperate tabs on the parent page.

    Also Id like the search box not to be a drop down box.

    Any suggestions wold be appreciated. If there are any books or links that discuss how to do this that would be great too.

    Thank you,

    Clint

  2. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    There's a search already built into WordPress. Navigate to Appearance->Widgets and try adding the Search Widget to your site's sidebar.

  3. TOPGUNN
    Member
    Posted 8 months ago #

    I know theres a search bar but my questions are more related to setting up the site for autodirecting from the search bar on the parent page to child pages. i dont want to see child page tabs on the parent page too.

    thanks for your response

  4. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    If I understand you correctly and you don't want child pages to appear on the search results, that could be handled via your theme's search.php template file.

  5. TOPGUNN
    Member
    Posted 8 months ago #

    where can i access that file? thank you

  6. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    If your theme has a search.php file, it will be in the theme's folder and accessible via Appearance->Editor. If you can't find the file (and not all themes do contain a search.php template file) you'll need to create one.

  7. tomaltman
    Member
    Posted 8 months ago #

    esmi is correct - but this is not a simple task.

    You'd need to have them search for the perfect phrase to match something unique about the child page...

    You may to take a look at jobs.wordpress.net and get some help...

  8. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    You'd need to have them search for the perfect phrase to match something unique about the child page...

    What if you hid the child links based on post_parent but replaced those links with some sort of place-holding text that included a link to the parent page? It should be possible to come up with something that was still effective, yes?

Reply

You must log in to post.

About this Topic