WP Default Search Not Getting Replaced.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support WP Default Search Not Getting Replaced.

This topic contains 14 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 6 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #31285
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello,

    The wp default search is not getting replaced by the plugin. Please see the video below.

    https://share.getcloudapp.com/P8ukxG61

    I talked with the theme developer, and they are saying that this plugin developer can only solve the issue.

    Please let me know on priority.

    #31292
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    If it is not replaced automatically, then the theme has the search bar hard-coded and not using the get_search_form hook – in that case the opposite is true, they should be the ones knowing in which file is the header search bar is integrated. Please let me know if they sent you any details or instructions about that.
    I am more than happy to help you with that, but I need to know which file has the header search hard-coded, so it can be replaced manually. I strognly recommed creating a child theme for that as well, so theme updates does not override any changes made to the theme files.

    I think there are some other issues as well, as I tried to open the header search, but nothing is shown when I’m clicking it: https://www.youtube.com/watch?v=nPIOODxyv_w&ab_channel=ErnestMarcinko

    Best,
    Ernest Marcinko

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


    #31297
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello,

    I talked with the theme developer, and he replied to me

    That’s correct the GP Navigation Search is adding a hardcoded form.
    The link: https://generatepress.com/forums/topic/replace-gp-search/#post-1272331
    Provides the PHP Snippet you will use to replace the hardcoded form with that plugins shortcode.

    Sir, I don’t want to go for the child theme option.

    Please let me know what we have to do ahead to make it work for us.

    #31307
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    That snippet looks promising, you probably don’t need a child theme after all.

    Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter( 'generate_navigation_search_output', function() {
        return sprintf(
            '<div class="navigation-search">%s</div>',
            do_shortcode( [wpdreams_ajaxsearchpro id=2]' )
        );
    } );

    Based on their recommended snippet, this should work.

    Best,
    Ernest Marcinko

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


    #31311
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello,

    Sir, after adding the above function PHP, I got the error. Please the below image link.

    http://prnt.sc/xprghs

    Please let me know further

    Attachments:
    You must be logged in to view attached files.
    #31313
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    May have been an error there, try this:

    add_filter( 'generate_navigation_search_output', function() {
        return sprintf(
            '<div class="navigation-search">%s</div>',
            do_shortcode( '[wpdreams_ajaxsearchpro id=2]' )
        );
    } );
    Best,
    Ernest Marcinko

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


    #31316
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello sir,

    Can you please check both codes are the same I think?

    #31317
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello,

    Please ignore the last message.

    I added the PHP, and the search gets replace by your plugin. But the plugin is not working. Please see the below video that will explain things better.

    https://share.getcloudapp.com/L1uNKNbj

    #31323
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The plugin script files are completely missing from the site footer. Make sure to clear all layers of cache, and that within a cache plugin you have not disabled the javascript file loading.

    Best,
    Ernest Marcinko

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


    #31331
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello sir,

    Okay, after clearing the cache plugin is working.

    But there is a problem with the mobile view. Please see the below video.

    https://share.getcloudapp.com/Z4u6vjE6

    Let me know further.

    #31343
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The shortcode seems to be printed 2 times by the theme in the header. Try this custom CSS to make the first one invisible on mobile screens:

    @media (max-width: 768px) {
        .asp_m_2_1 {
            display: none !important;
        }
    }
    Best,
    Ernest Marcinko

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


    #31444
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello,

    I don’t know. But there is something wrong with your plugin.

    The main issue is that it is showing connection error 400. Please see the image in the attachment.

    Second, all the things PHP & CSS I added after that, I’m seeing that the search bar is coming below the heater. It is hiding below the menu option. Please see the image in the attachment.

    Please let me know the perfect solution.

    Attachments:
    You must be logged in to view attached files.
    #31451
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Please note, that this qualifies as a customization request, so I cannot guarantee any “perfect” solution. Placing the shortcode and implementing custom codes are developer tasks, so we cannot guarantee anything.

    1. The overlap issue is caused by the incorrect z-index value on the navigation seach element, which is part of the theme itself. Try this custom CSS, it should work:

    .navigation-search {
       z-index: 9999999999;
    }

    2. As for the error 400 issue, I switched to the custom ajax handler option. If you clear the cache it should be all right now.

    Best,
    Ernest Marcinko

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


    #31454
    diveshjotwani2617
    diveshjotwani2617
    Participant

    Hello,

    After clearing the cache, some new issue has arisen. Please check the attached image.

    The CSS for overlapping also not working as it should be.

    Attachments:
    You must be logged in to view attached files.
    #31472
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Interestingly it was working just fine on any page except the home page. I switched the script compatibiltiy to “non-minified” since autoptimize will minify anyways, and now it is all right on the home page as well: https://i.imgur.com/JxCCVVf.png
    It was probably a minification conflict of some sort, maybe in combination with cloudflare. Make sure to clear the browser cache as well.

    The CSS for overlapping also not working as it should be.
    Can you please elaborate?

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.