This topic has 2 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #161737
     toneee
    Participant

    Pressing the search button in the upper right menu instantly returns search results for “”. It’s also not clear that there’s a text box to the left of the search button, which is a minor CSS issue.

    1. How can we prevent/ignore “” results by highlighting the search field as a 50% white? (i.e. #main-search is required and highlights if empty upon validation)
    2. Is there a way to optionally hide the search bar?
    3. Is there a way to optionally search only certain post types?

     

    For search bar color example:

    .search-form input.header-search {background-color: #484848}

    Attachments:
    You must be logged in to view attached files.
    #162025
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #162310
     Radu
    Moderator

    Hi,

    1. There should be minimum 1 character entered in input search to can perform search, we have fixed that for the next update if you need that now tell me.

    2. You can use this css

    COPY CODE
    
    .second-menu .search-form-wrapper .search-form {
        display: none !important;
    }
    

    The css will be added to wp-admin -> theme options -> quick css.

    3. This can be acheived using a next code

    COPY CODE
    
     
    add_action( 'init', 'update_my_custom_type', 99 );
    /*Replace my-custom-type with your custom post type slug*/
    function update_my_custom_type() {
    	global $wp_post_types;
    	if ( post_type_exists( 'my-custom-type' ) ) {
    		// exclude from search results
    		$wp_post_types['my-custom-type']->exclude_from_search = true;
    	}
    }
    

    NOTE : Child theme needs to be installed and activated.

    The function needs to be pasted in wp-content/themes/buddyapp-child/functions.php

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?