Replace default theme search problem

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Replace default theme search problem

This topic contains 6 replies, has 2 voices, and was last updated by Drew Drew 6 years, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7685
    Drew
    Drew
    Participant

    Hi,

    thanks for the great search plugin 🙂

    1. I have try to replace the default theme search. The default theme search I use only on mobile devices. If you press the Search Icon it opens a popup and in the popup you find the ajax search field. Problem is the ajax search don’t work and if I press the search button it does work too.

    I have test it withe the Theme search bar replace option and with the

    code] <?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?>

    
    
     too in my functions.php (rehub/functions.php)
    
    The code looks like so:
    
    

    //Search popup
    function rehub_search_popup_block_footer(){
    ?&gt;
    &lt;div id="search-header-contents-wraper"&gt;
    &lt;div class="search-header-contents"&gt;
    &lt;div class="re_title_inmodal"&gt;&lt;?php _e(‘Search’, ‘rehub_framework’); ?&gt;&lt;/div&gt;
    &lt;?php get_search_form(); ?&gt;
    &lt;/div&gt;
    &lt;/div&gt;
    &lt;?php
    }
    add_action(‘wp_footer’, ‘rehub_search_popup_block_footer’);

    // Login / Register Modal
    if (rehub_option(‘userlogin_enable’) == ‘1’) {
    require_once ( locate_template( ‘inc/user-login.php’ ) );
    }

    // Compare functions
    if (rehub_option(‘compare_page’) != ”) {
    require_once ( locate_template( ‘inc/compare.php’ ) );
    }

    
    
    I have replace 

    &lt;?php get_search_form(); ?&gt;

     with 

    &lt;?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?&gt;

    2. Is the possible to style the search result page?

    sorry my english is not the best. hope you can help me.

    kind regards drew

    #7695
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. The problem is that by clicking on that search icon it creates a clone of the search instance, which results in duplicated element ids and names, and that is invalid HTML code. (so basically that search instance is twice on the same page with matching IDs) I’m guessing it’s how the menu was programmed, to copy elemetns over from another container.

    Unfortunately there is literally nothing I can do to make it work. I have investigated and tried different solutions on my console, but none of them worked. One of the issues is the cloning itself – it’s a very bad practice as it does duplicate elements without checking validity, and also every event handling attached to the original element gets detached. The re-attachment I would be able (and was able) to fix, but since there are elements with duplicated unique IDs, the script won’t work 🙁

    A better and cleaner solution would be to use some kind of pup-up script that does not clone the contents from somewhere else. You can easily find one, this for example is extremely well done and very neat: http://tympanus.net/codrops/2013/06/25/nifty-modal-window-effects/

    2. The (non-ajax) search results page design is exclusively a theme feature, the search plugin can only add/replace items there, but the actual layout is coming from your currently active theme.

    The HTML code is usually generated in the search.php file in the theme folder, you can add/remove parts there I guess, but I suggest asking the theme author if you are not sure. He will probably suggest to create a child theme and will be able to tell where the exact styling for the search page is located.

    Let me know if you need any more help or suggestions!

    Best,
    Ernest Marcinko

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


    #7697
    Drew
    Drew
    Participant
    You cannot access this content.
    #7703
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Drew,

    I have tried to load up the URL provided but the server did not respond but after 5 minutes. Let me know if it’s resolved and I will check again!

    Best,
    Ernest Marcinko

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


    #7705
    Drew
    Drew
    Participant

    Hi Ernest,

    sorry now it should work. My server spinning at the moment a bit.

    best greetings
    drew

    #7716
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I have tried via multiple mobile devices, but I was getting results fine with all of them. Screenshot of my phone: https://i.imgur.com/h8AjRkO.jpg
    I’ve also hooked up the phone to check the error console, but everything was all right. It might have only been a brief server outage or something similar.

    Best,
    Ernest Marcinko

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


    #7730
    Drew
    Drew
    Participant
    You cannot access this content.
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.