Removing the search section from some pages

Discussion in 'ClassiCraft WordPress Theme' started by alnaami, Dec 13, 2013.

  1. M5LASTER

    M5LASTER Member

    Joined:
    Oct 21, 2013
    Messages:
    232
    Likes Received:
    0
    Hi there,

    I would like to remove the search section as shown in the image below from some pages. For example, when the user is in the process of creating an ad there is no need for this search section to be displayed.

    Thanks, Mike
     

    Attached Files:

  2. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    Paste this code in Custom CSS
    Appearance > Theme Option > Styling Option > Custom CSS

    Code:
    .search_wrapper {
    display: none;}
    Thanks & Regards
    Nitesh Raghuwanshi
     
  3. M5LASTER

    M5LASTER Member

    Joined:
    Oct 21, 2013
    Messages:
    232
    Likes Received:
    0
    Hi Nitesh,

    I'd like to remove the search box from select pages, not from all pages. How can I achieve that?
    I guess, another question would be, how would I enforce the css style per page?

    Thanks,
    Mike
     
  4. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Through page id selector you can apply css style only on the specific pages.

    Paste the following code in your Custom CSS
    (Appearance -> Theme Options -> Styling Options -> Custom CSS)

    Code:
    .page-template-template_ad_new-php .search_wrapper {
    display: none;
    }
    This will remove the search bar from the post free add page.
     
  5. careykidd

    careykidd New Member

    Joined:
    Feb 18, 2015
    Messages:
    19
    Likes Received:
    0
    how about from a login page?
     
  6. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello careykidd !

    PHP:
    function login_form_style(){
      echo 
    "<style>.search_wrapper{display:none;}</style>";
    }
    var_dump($_GET);
    if(isset(
    $_GET['action']) && $_GET['action']=='login'){
      
    add_action('wp_head','login_form_style');
    }
    Please use above code in functions.php
    http://screenpresso.com/=q5EAe


    Thanks & Regards
    Pramod
     
  7. careykidd

    careykidd New Member

    Joined:
    Feb 18, 2015
    Messages:
    19
    Likes Received:
    0
    thank you!
     
  8. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    you can also make a copy of the header.php, rename it like header-noSearch.php, remove the search form from the file header-noSearch.php, and then on a particular page, call the header this way. get_header('noSearch');
     

Share This Page