• Resolved memwebproject

    (@memwebproject)


    Hi,

    my search menu is visible only in one woocommerce category ( and all its subcategories) but in result page it is not visible, can you help me to show my menu also in result page?
    navigate only in product line -> optika balances to check the issue : in optika balances there is the menu “Balances Search” i want it also in search result page.

    best regards

    • This topic was modified 6 years, 8 months ago by memwebproject.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author shazdeh

    (@shazdeh)

    Hi,

    is_search is the function you’re looking for (codex: https://codex.wordpress.org/Function_Reference/is_search). You can add:

    
    is_search() || 
    

    to the beginning of the logic you have added previously, it then reads: “if we’re on search result pages OR –condition set previously– then show the menu item.”

    Thread Starter memwebproject

    (@memwebproject)

    perfect, it works.

    i have more tnah one search menu, can i add a ID in “is_search() ||” ?
    for example in balances my search is ” aws_search_form id=”2″ ”

    best regards

    Plugin Author shazdeh

    (@shazdeh)

    Not really sure what “aws_search_form” is, is that sent via GET (you could see it in the browser address bar)? If so you could do:

    
    ( is_search() && isset( $_GET['aws_search_form'] ) && $_GET['aws_search_form'] == 2 ) || 
    

    So now it reads: if we’re on search results page AND “aws_search_form” sent via GET is set to 2, OR –whatever comes next– then show the menu.

    Thread Starter memwebproject

    (@memwebproject)

    thanks for your replay
    my address bar in search result page is : http://www.optika-italy.com/?s=series&post_type=product&type_aws=true&id=2&filter=1

    so i changed your code in : ( is_search() && isset( $_GET[‘id’] ) && $_GET[‘id’] == 2 ) ||

    right?

    thanks a lot for your help

    best regards

    Plugin Author shazdeh

    (@shazdeh)

    From what you have there, we could infer:

    
    ( is_search() && isset( $_GET['type_aws'] ) && isset( $_GET['id'] ) $_GET['id'] === 2 ) || 
    
    Thread Starter memwebproject

    (@memwebproject)

    fantastic support!!!

    thanks a lot

    best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display menu in search result page’ is closed to new replies.