• Resolved mrprainx

    (@mrprainx)


    Hello. I would like to show the search popup icon in a menu.

    Is this possible? And if yes, how?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Yes you can, if you have idea about wp_nav_menu_items filter you can insert your custum menu e.g:-

    function add_search_form($items, $args) {
              if( $args->theme_location == 'top' ){
              $items .= '<li class="menu-item">'
                      .do_shortcode('[serach-popup]')
                      . '</li>';
              }
            return $items;
    }
    add_filter('wp_nav_menu_items', 'add_search_form', 10, 2);

    In above code you have to replace ‘top’ to your theme_location
    I have write code for top menu theme location ( https://nimb.ws/9WPGSF )

    Thanks

    Thread Starter mrprainx

    (@mrprainx)

    Ok thank you.

    And what about adding that icon in a already existing menu? I mean, like it is a menu item.

    For example here:

    • https://www.cies.it/
    • We have a menu with items. Just add the icon as the first/last/whatever.

      Thank you.

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Sorry for the inconvenience.
    This plugin only for adding search popup and menu popup add by shortcode, not to insert the shortcode in the existing menu item.
    This functionality not available in the plugin.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Place this into a menu’ is closed to new replies.