Live search by custom tag

‘post_type’ => ‘custom_type’ is a reference to your post type. You need to change custom_type to the actual post type that you created / registered. So, if your post type was my_cool_dregs then the line would be: ‘post_type’ => ‘my_cool_dregs’ The same holds true with ‘taxonomy’=>’custom_tags’ You need use the actual taxonomy name that you … Read more

members only products

Use this code on your child theme’s functions.php file.. //Hide for non-logged-in users (public visitors) function bp_logged_out_page_template_redirect() { if( ! is_user_logged_in() && is_page( ‘members’ ) || is_page( ‘activity’ ) || bp_is_user() ) { wp_redirect( home_url( ‘/register/’ ) ); exit(); } } add_action( ‘template_redirect’, ‘bp_logged_out_page_template_redirect’ ); The above snippet will do: •IF the user is not … Read more

How to use jQuery validation to set the search bar to accept only a specific input?

This code does the job (there is p instead of a) jQuery(function(){ jQuery(“.search-submit”).click(function(){ jQuery(“.error”).hide(); var hasError = false; var searchReg = /^[p0-9]+$/; var searchVal = jQuery(“.search-field”).val(); var searchLen = searchVal.length; var num1 = [‘1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9’]; var num0 = [‘0′,’1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9’]; if(searchLen < 3) { jQuery(“.search-field”).after(‘<span class=”error”>Enter at least 3 characters.</span>’); hasError = true; } else if(searchLen > … Read more

How to exclude a part of a page in search results

Copy below code and paste in function.php file to exclude pages from search results. if (!is_admin()) { function wpb_search_filter($query) { if ($query->is_search) { $query->set(‘post_type’, ‘post’); } return $query; } add_filter(‘pre_get_posts’,’wpb_search_filter’); }

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