Exclude the category from the WordPress loop

I have this code for the loop, and I need to exclude a category 4 from this loop. Any suggestions on how to achieve this? Code that starts the loop <?php if(have_posts()): ?> <ol class=”item_lists”> <?php $end = array(3,6,9,12,15,18,21,24,27,30,33,36,39,42,45); $i = 0; while (have_posts()) : the_post(); $i++; global $post; ?> 4 s 4 you could … Read more

exclude category from get_posts?

getting posts by cat with get_posts but need to exclude another cat called london or id 10. is this possible? best, Dc. // array(7,-10) $laargsM = array(‘category’ => 7, ‘posts_per_page’=>300, ‘orderby’=>’title’, ‘order’=>’asc’ ); $la_shapes = get_posts( $laargsM ); 1 1 as ‘get_posts()’ uses the ‘WP_Query()’ parameters, i would assume that this should work: $laargsM = … Read more

Exclude Current Post from Recent Posts Loop

what would be the best way to exclude the current post I am viewing from this recent posts query. Thank You! <?php global $post; if (in_category(‘top-lists’)) { $myposts2 = get_posts(‘numberposts=5&offset=0&category=7’); } else if (in_category(‘playlists’) || in_category(‘playlistall’)) { $myposts2 = get_posts(‘numberposts=5&offset=0&category=6,37’); } else if (in_category(‘news’) || in_category(‘news’)) { $myposts2 = get_posts(‘numberposts=5&offset=0&category=95’); } else { $myposts2 = … Read more

How do I exclude plugins from getting automatically updated?

There is an opt-in filter that allows all plugins on my site to receive automatic updates: add_filter( ‘auto_update_plugin’, ‘__return_true’ ); I like this feature, but I don’t want all my plugins to be updated automatically. How can I allow some plugins to be updated automatically, while excluding those I want to do manually? 2 Instead … Read more

Exclude post ID from wp_query

How can I exclude one specific post from a WP_Query query? (For example, show all posts apart from a post with the ID 278) I’ve tried the post__not_in argument but it just removes all posts.. Any help would be great. Here is my current query <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(array( … Read more