Delete subcategories in the search bar

Discussion in 'ClassiCraft WordPress Theme' started by pixelg, Aug 17, 2014.

Thread Status:
Not open for further replies.
  1. pixelg

    pixelg New Member

    Joined:
    Nov 13, 2013
    Messages:
    14
    Likes Received:
    0
    Hello, in the search bar I would like to see only the main categories without subcategories. how can I do? thanks for the support
     

    Attached Files:

  2. Yogesh

    Yogesh Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,052
    Likes Received:
    41
    Hello Pixelp,

    To show only categories you have to edit multiple_search.php file from editor.
    Go to --> Appearance >> Editor >> multiple_search.php
    and paste following code in place of $output .="<option value='" . $termid . "'>" . $term_name . "</option>"; as shown in screenshot.
    PHP:
    if($term->parent == ){
      
    $output .="<option value='" $termid "'>" $term_name "</option>";
    }
    This will resolve your issue.

    Thanks & Regards
    Yogesh Bhade
     
  3. pixelg

    pixelg New Member

    Joined:
    Nov 13, 2013
    Messages:
    14
    Likes Received:
    0
    Great, it worked! thank you
     
Thread Status:
Not open for further replies.

Share This Page