WP Query Obj: Set value to be unequal | Hide media by admin
The method is similar, just exclude the author by prefixing the id with a minus sign: $wp_query_obj->set( ‘author’, ‘-1’ ); See WP_Query for a full list of query arguments.
The method is similar, just exclude the author by prefixing the id with a minus sign: $wp_query_obj->set( ‘author’, ‘-1’ ); See WP_Query for a full list of query arguments.
<?php if ( ! is_page( array( ‘About’, ‘Contact’ ) ) ) : ?> <!– Navigation code –> <?php endif ?>
You need to wrap your ids in an array. $args = array(‘author’=> $author_id, ‘posts_per_page’ => 10, ‘paged’ => $paged, ‘category__not_in’ => array( 16, 19, 1, 20 ) ); http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters
Assuming your function runs generally, to limit it to a specific page use if( is_page( 2094 ) ) { add_filter(“sjb_job_location_filter_args”,”exclude_jobs_locations_uk”); } The location of the function definition doesn’t matter. P.S. Regarding excluding categories . . . yeah, we’d need to know a lot more about what’s going on with the called (plugin?) function
try: <?php next_posts_link(‘Next Page »’, $the_query->max_num_pages); ?> <?php previous_posts_link(‘« Previous Page’, $the_query->max_num_pages); ?>
Please take a look at this example; $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘movie_genre’, ‘field’ => ‘slug’, ‘terms’ => array( ‘action’, ‘comedy’ ) ), array( ‘taxonomy’ => ‘actor’, ‘field’ => ‘id’, ‘terms’ => array( 103, 115, 206 ), ‘operator’ => ‘NOT IN’ //you must set the … Read more
Something like this should work from your functions file as long as you use the correct conditional tag for your CPT archive: function exclude_single_post_cpt($query) { if (is_post_type_archive(‘event’) && $query->is_main_query() && !is_admin() ) { $query->set(‘post__not_in’, array(1646)); } } add_action(‘pre_get_posts’, ‘exclude_single_post_cpt’);
Firstly, your tax query is a little jumbled. The first nested array should actually be at the ‘root’ of your query_posts() argument, with tax_query as a key among them; array( ‘post_type’ => ‘review’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 10, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘reviewcats’, ‘terms’ => array( ‘featured’ ), ‘field’ … Read more
This may help… http://www.kimwoodbridge.com/how-to-exclude-a-category-from-the-sidebar-list-in-wordpress/
Assuming the comment_author is a User ID, try: if(user_can($result->comment_author,’manage_options’)){ $output .= “<li>”.(($result->comment_author_url) ? “<a href=””.$result->comment_author_url.””>” : “”).$result->comment_author.(($result->comment_author_url) ? “</a>” : “”).” (“.$result->comments_count.”)</li>”; } If not, one can use get_comment, and select the comment_ID in the SQL statement. You can then use the object returned to grab the user ID of the comments author, and do … Read more