Custom author search

Jus add the parameter ‘author__in’=> array( 2, 3, 5 ) to $args and pass the author ID or IDs. You’ll get the results. $args = array( ‘author__in’=> array( 2, 3, 5 ), // array of authors IDs you like to include ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 ); And I … Read more

Issue with WordPress category search

You can search post by modify the query using pre_get_post filter. add this code inside your functions.php file add_filter(‘pre_get_posts’, ‘search_by_category’); function search_by_category($wp_query) { if (isset($_GET[‘cat’]) && !is_admin()) { $wp_query->set(‘category__in’, array($_GET[‘cat’])); } } Before using any query variable you must have to register/add using add_query_var. function add_category_query_string() { global $wp; $wp->add_query_var(‘cat’); } add_filter(‘init’, ‘add_category_query_string’); let me … Read more

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