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

  • Author
  • #173925
     jamesbuddyrogers
    Participant

    Is there any way to remove the search tab from the main navigation?

    Ideally I would like this search bar to search members. Is that possible? If not, I would just like to remove it is only reading pages for info, nothing from the forums or members profiles

    let me know. cheers

     

    #173938
     Kieran_SQ
    Moderator

    Hi,

    To enable or disable the menu please go to WP Admin > SweetDate > Layout Settings > Scroll to: Ajax Search in menu. You can then toggle the menu search on or off.

    With regards to extending this for post types other than users I will ask my colleague @Radu to take a look at this ticket for you.

    Thanks,

    Kieran.

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

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

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #173947
     jamesbuddyrogers
    Participant

    Ok thanks. For now I have turned it off. If @radu knows a way to make that search member names I will happily turn it back on.

    cheers

    #174108
     Radu
    Moderator

    Hi,

    So you want to have the search in the menu only for registered members ?

    Cheers
    R.

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

    Yes.

    #174209
     Radu
    Moderator

    Just add this code to functions.php

    COPY CODE
    
    
    if ( ! function_exists( 'kleo_search_menu_item' ) ) {
        /**
         * Add search to menu
         *
         * @param string $items
         * @param oject $args
         *
         * @return string
         */
        function kleo_search_menu_item( $items, $args ) {
            if ( $args->theme_location == 'primary' ) {
                ob_start();
                get_template_part( 'page-parts/header-ajaxsearch' );
                $form = ob_get_clean();
                
                if(is_user_logged_in()) {
                    $items .= '<li id="nav-menu-item-search" class="menu-item kleo-menu-item-search"><a class="search-trigger" href="#"><i class="icon icon-search"></i></a>' . $form . '</li>';
                }
            }
    
            return $items;
        }
    }
    

    NOTE : Child theme needs to be installed and activated.

    The function needs to be pasted in wp-content/themes/sweetdate-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
    #174223
     jamesbuddyrogers
    Participant
    This reply has been set as private.
    #174321
     Radu
    Moderator

    Hi,

    Make sure to paste the code inside the PHP tag

    https://pastebin.com/raw/MPkvAQcP and paste it again

    It works just tried on my local install.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #174326
     jamesbuddyrogers
    Participant
    This reply has been set as private.
    #174393
     Radu
    Moderator

    Hi,

    Paste the code exact like on this link : https://pastebin.com/raw/83WML0X8

    with no ?> php closing tag at the end.

    Let me know

    Cheers
    R.

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

    Still can’t get it to work.

    #174728
     Radu
    Moderator

    Very odd, tried multiple times and it works for me…

    Make sure the code to be there and If you have any cache plugin delete the cache or modified resources.

    If still not works provide ftp + wp admin credentials to take a closer look in a private reply.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #174901
     jamesbuddyrogers
    Participant
    This reply has been set as private.
    #174964
     Radu
    Moderator

    Done,

    It’s added

    There was no snippet in your child theme,

    something it’s wrong there you have sweetdate-child folder in sweetdate-child folder…. so it’s wrong, you will have to delete the sweetdate-child from wp-content/themes/sweetdate-child/

    see screenshot to understand what I mean

    Cheers
    R.

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

    I have removed the child folder inside the child folder. Must have copied by mistake.

    However, the search bar at the top is NOT searching member names. Still displays no results when it works from the members page search tab.

    Not sure how you are seeing this work as it won’t work for me on two differnt computers and my phone.

    #175079
     Radu
    Moderator

    Checked again and it works as it should…. and the snippet it works perfectly tested from begining before providing to you.

    empty all caches reboot router clear computer and browser cache

    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 16 posts - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?