Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #959943
search option
Closed

Comments

  •   administration_hopeparis started the conversation
  •  7,092
    Oliver replied

    HI!

    pls. use following css:

    li.menu-item.menu-item-search {
        display: none !important;
    }

    or

     

    or in the TheGem child theme add next code to functions.php file:

    function thegem_child_init() {
        remove_filter('wp_nav_menu_items', 'thegem_menu_item_search', 10);
    }
    add_action('init', 'thegem_child_init');

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •  2
    administration_hopeparis replied

    Hello thanks for all this answers.

    I use the second methode but we can always shearch by usign : http://hopeparis.fr/?s=

    How to completely desactive this option ?

    Thanks a lot

  •  7,092
    Oliver replied

    HI!

    pls. check this plugin:

    https://srd.wordpress.org/plugins/disable-search/

    Or try to add this code to functions.php of the child theme:

    function fb_filter_query( $query, $error = true ) {
    if ( is_search() ) {
    $query->is_search = false;
    $query->query_vars[s] = false;
    $query->query[s] = false;
    // to error
    if ( $error == true )
    $query->is_404 = true;
    }
    }
    add_action( 'parse_query', 'fb_filter_query' );
    add_filter( 'get_search_form', create_function( '$a', "return null;" ) );
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •  2
    administration_hopeparis replied

    The plugin seems working thanks