if Post Type show else Show problem.. need your help please.. (1 post)

  1. Alex.R
    Posted 3 years ago #

    I have a question for those with more experience..

    I have 2 search form, one is the native search form of my blog, and the other one is for a custom post type..

    Here's the code I have in my header.php file...

    <?php if( get_post_type() == 'resume' ) { get_header('resume-search'); } else { get_header('search'); } ?>

    Now this code works so far for what I need, basically show resume-search form if on resume post type else show the native search form everywhere else..

    One problem with this is when using the search form for resume, my url changes from http://localhost/wp/?post_type=resume to http://localhost/wp/?resume_search=true&s=random+search basicaly from post_type=resume to resume_search=true.

    So I was wondering how I can fix this so the search form for resume follows with the search query as well.. is this possible to do? Your input will help me greatly and I would appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.