Add Ajax Pro to my top menu

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Add Ajax Pro to my top menu

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11523
    thorntonp72
    thorntonp72
    Participant

    Hi,

    Is there any way to add this search option to my menu? I have tired a variety of techniques but none seem to work such as some plugins etc. There must be any easy way?

    Thanks.

    Paul

    #11531
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    There is no easy way unfortunately. WordPress does not allow placing any shortcodes as menu items, due to their structure and design I guess. It usually creates more issues, mostly regarding styling (vertical alignments, floating issues, placement problems, margin and padding issues, malfunctioning scripts etc..).

    There is an experimental way of executing the search shortcodes in menus, but it needs an additional code, and it may not work as expected, or may not work at all. It’s worth a try though. Developers usually don’t make menus to be able to hold complex interactive elements, as it is already a highly interactive element, so please don’t expect too much of it.

    1. Put this code into the functions.php file in your active theme directory:

    This will try to detect if the menu title is a search shortcode. If so, it will be executed.

    2. On the back-end menu editor, simply add a new custom menu item, with the search shortcode as it’s title: https://i.imgur.com/9b6P1sZ.png
    3. Save the menu, and hope for the best.

    On the default twenty sixteen theme it works perfectly: https://i.imgur.com/BKRHRVs.png
    Then again, that theme is very well made and follows all rules regarding theme design and development, so it’s the best case scenario. I’ve seen some crazy menu solutions in very popular, best seller themes, so I highly doubt this will work as expected in every case.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11561
    thorntonp72
    thorntonp72
    Participant

    Thanks for that, but it did not work. It appears then disappears. I will forget about it for now and move on 🙂

    Please close the ticket and thanks for your help.

    #11562
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Add Ajax Pro to my top menu’ is closed to new replies.