• Alex.R

    (@alexr-1)


    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 https://localhost/wp/?post_type=resume to https://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.

  • The topic ‘if Post Type show else Show problem.. need your help please..’ is closed to new replies.