Hi Dylan,
Please provide a URL to the site in question with the additional search form so I can take a look for you and advise.
Peter
Hi Peter,
No worries:
https://www.replgroup.com
When you inspect you’ll see the search form in question is at the top of the body. For whatever reason, all Analytics etc gets pushed into the body.
If I deactivate, everything goes back to its rightful place. Its a strange one. Even checked our searchform.php in case that was causing errors.
Thanks,
Dyl
Hey there,
That form is not from my plugin so I am not sure where it is coming from. Also, as you say your site code is all looks messed up (there is meta data etc. in the body and things are not where they should be).
I can only guess that you are using the Shortcode and then inserting this in the wrong place, can you please let me know if you have the shortcode turned on and if so where/how you are echoing this is in your template files?
Peter
Hey Peter,
First, thank you so much for helping with this issue.
So I think the conflict may arise here, in the functions.php file:
add_filter(‘wp_nav_menu_items’,’add_search_box_to_menu’, 10, 2);
function add_search_box_to_menu( $items, $args ) {
if( $args->theme_location == ‘main-menu’ )
return $items.get_search_form();
return $items;
}
Thats how we add the Search to the desktop menu. When I comment this out, and have the plugin activated, everything works ok.
Thanks,
Dylan
Hey Dylan,
That looks exactly like your issue. It was probably a false negative with my menu because my menu uses wp_nav_menu which would of then called your filter.
Glad we found the issue together 🙂
Peter
Hey Peter!
Gone an alternative route for the search on desktop.
Thanks again for all your help.
Dyl
Hey Dyl,
Great news and thanks for letting me know.
Have a great day
Peter