Search doesn’t return anything

Might not be the real cause, but you have a JS error due to badly formatted JS – the following lines: <script type=”text/javascript”> jQuery(document).ready(function( $ ){ jQuery(“a[href=’#aiwoosearch#’]”).attr(‘onclick’, ‘parentNode.submit();’); jQuery(“a[href=’#aiwoosearch#’]”).attr(“href”, “javascript:;”); }); </script> Those quote marks are wrong “ & ‘ try ” & ‘ instead and test again with your JS console open in inspector.

Call product search from custom hook

What I understood is that no AJAX is needed. If somebody don’t understand all the fancy example around, you just need to use the pre_get_posts hook. In my case what I did is: function custom_product_search($query) { $query->query_vars[‘post_parent’] = htmlentities($_GET[‘model’]) ?? htmlentities($_GET[‘make’]); return $query; } add_action(“pre_get_posts”, ‘custom_product_search’); I don’t know if this is the correct solution … Read more

Adding ELSE argument to AJAX Live Search for “No results found”

Try to not using endif and endwhile, just use curly brakets {} to determinate ifs body or add :after elseelse:` Your problem is that you mix two syntaxes. Read this to fully understand how to write alternative syntax https://www.php.net/manual/en/control-structures.alternative-syntax.php add_action(‘wp_ajax_data_fetch’ , ‘data_fetch’); add_action(‘wp_ajax_nopriv_data_fetch’, ‘data_fetch’); function data_fetch() { $post_search_query = new WP_Query(array(‘posts_per_page’ => -1, ‘s’ => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)