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 8 years, 2 months ago.
- AuthorPosts
- February 11, 2016 at 8:15 pm #7685
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(){
?>
<div id="search-header-contents-wraper">
<div class="search-header-contents">
<div class="re_title_inmodal"><?php _e(‘Search’, ‘rehub_framework’); ?></div>
<?php get_search_form(); ?>
</div>
</div>
<?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
<?php get_search_form(); ?>
with
<?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?>
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
February 12, 2016 at 3:07 pm #7695Hi!
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 :)
February 14, 2016 at 3:23 pm #7697You cannot access this content.February 15, 2016 at 10:48 am #7703Hi 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 :)
February 15, 2016 at 11:02 am #7705Hi Ernest,
sorry now it should work. My server spinning at the moment a bit.
best greetings
drewFebruary 16, 2016 at 9:33 am #7716Hi!
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
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 17, 2016 at 8:55 am #7730You cannot access this content. - AuthorPosts
You must be logged in to reply to this topic.