Searchform for searching specific categories

A simple search in codex shows there are some parameters you can set to exclude some categories for example : <?php $args = array( ‘show_option_all’ => ”, ‘show_option_none’ => ”, ‘orderby’ => ‘ID’, ‘order’ => ‘ASC’, ‘show_count’ => 0, ‘hide_empty’ => 1, ‘child_of’ => 0, ‘exclude’ => ”, ‘echo’ => 1, ‘selected’ => 0, ‘hierarchical’ … Read more

Add meta tag to search results

Well I am asuming you want to amend the <title> tag? Add this in functions.php add_filter(‘wp_title’, ‘my_custom_page_title’); function my_custom_page_title($title) { global $s; if( isset($_REQUEST[‘author_name’]) && is_search() ) { $title=”Search Results for “.$s.’ from author ‘.$_REQUEST[‘author_name’]; } return $title; } If $s returns blank replace that with $_REQUEST[‘s’]

Manipulating a query

You might try to add a posts_where filter in your pre_get_posts hook: function my_pre_get_posts( $q ){ if( $q->is_main_query() ) add_filter( ‘posts_where’, ‘my_posts_where’ ); return $q; } ! is_admin() && add_action( ‘pre_get_posts’, ‘my_pre_get_posts’ ); where function my_posts_where( $where ){ // your custom replacements on the $where string // … // remove the filter remove_filter( current_filter() , … Read more

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