How to exclude one post format from search result?

You could probably do it my modifying the loop through the pre_get_posts hook. function wpse163459_search_exclude_post_format( $query ) { if( $query->is_main_query() && $query->is_search() ) { $tax_query = array( array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-quote’ ), ‘operator’ => ‘NOT IN’, ) ); $query->set( ‘tax_query’, $tax_query ); } } add_action( ‘pre_get_posts’, ‘wpse163459_search_exclude_post_format’ );

Exclude Tags by Array

You could achieve this with get_terms() and ‘name__like’ => ‘Author:’ argument. See linked documentation. From architecture perspective, however, you probably shouldn’t be (ab)using tags for this. It would make sense to split your authors into custom taxonomy. It would be more clear semantically, as well as easier to deal with in interface and code.

$query->set( ‘post_type’, ‘post’ ); not working

After Milo’s help I found a function where it altered the search query: if( is_search() && empty($_GET[‘post_type’]) && !is_admin() ) { global $wpdb; $query = get_search_query(); $query = $wpdb->esc_like( $query ); $where .= ” OR {$wpdb->posts}.ID IN (“; $where .= “SELECT {$wpdb->postmeta}.post_id “; $where .= “FROM {$wpdb->posts}, {$wpdb->postmeta} “; $where .= “WHERE {$wpdb->posts}.post_type=”page” “;<-page to … Read more

How to exclude one category

You can use “category__not_in” array parameter. Also, I’ve modified your code just a bit, you should use wordpress best practice which is “if -> while” to display the posts. Please try these code below as I haven’t tested it yet. <?php // Default arguments $args = array( ‘posts_per_page’ => 6, // How many items to … Read more

List child pages, exclude the current page

Looks like a syntax error to me. Try: wp_list_pages(“title_li=&child_of=2143&exclude=$current_post_id”) OR wp_list_pages(“title_li=&child_of=2143&exclude=”.$current_post_id) Also I will suggest to pass parameters as array instead of a string, for better debugging. wp_list_pages( array( ‘child_of’ => 2143, ‘exclude’ => array( $current_post_id ), ); Make sure $current_post_id is giving proper value.