Just use a custom query like this:
$exclude_cats="2,52,3";
$posts_per_page="4";
$loop = new WP_Query("category__not_in=$exclude_cats&posts_per_page=$posts_per_page");
if($loop->have_posts()):
while($loop->have_posts()): $loop->the_post();
//Do stuff here the_content(), the_title() etc...
endwhile;
else:
//Do something here
endif;
Related Posts:
- How to return results of a get_posts() in explicitly defined order
- Modify main WordPress loop with a parse_query filter
- How should I intercept the main query and inject custom join / order by / group by criteria
- Dynamically excluding current page id
- How to order results by date and meta key?
- Static Front-Page Excerpts
- Is it possible to query_posts using post__in and then Loop through them in the ordered they were queried?
- query_posts() ALWAYS displays something?
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- Custom loops, sticky posts, and pagination nightmare
- Filter Loop by Custom Field Value
- Modify loop but keep the original query, what am I doing wrong?
- When to use WordPress loop or Foreach loop?
- Post per page not working if no category specified
- Calling Posts from Specified Cat
- How do I query based on the modified date?
- Script that gets the first tag of post and query all other posts with the same tag
- How to add an “or” instead of and “and” (&) in a WordPress query?
- Modify main loop query for paged and meta key
- Create a Loop with Posts Ordered by Most Recent Comments
- query_posts and sub pages?
- The_content display a different content from a previous loop
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- Including post data in a sidebar occurring outside of and before the Loop
- Multiple loops with / without sticky posts and different post limits
- Some doubts about how the main query and the custom query works in this custom theme?
- Is there a way to exclude the content from the post variable to save on RAM usage?
- Display/query post formats
- How to query post by user role?
- query_posts() in function makes global $wp_query out of sync?
- WordPress Custom Query
- advice on creating a ‘related posts’ query like the one used on stackexchange
- Help altering a query to exclude all but standard post format
- How to limit search to first letter of title?
- Post Title displaying but not in the wrapped HTML I need
- Two posts in same div – WP loop
- How to ensure that is_search() return false after query_posts
- Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- ‘category__and’ for custom taxonomy?
- Query 1 taxonomy term, exclude another
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Exclude first 2 posts with meta_key from loop
- Pagination on custom query
- Ordering terms before displaying posts
- Sort Posts by Multiple Meta Values [duplicate]
- Querying posts with meta value that begins with a certain pattern
- Adding Variables to post query
- Unable To Get Published posts using query_posts
- Read More is not working in query posts
- How to insert content from another Custom Post type into Post?
- How to reverse the order of WordPress blog posts?
- Trouble with get_next_post() get_previous_post() returning null
- popular post weekly and monthly
- Multiple loops without repeating content
- Possible to display posts containing a short code ?
- Display all posts that were published before full post on single.php
- How to run a SQL Query for character in Post Titles
- Authors List page : how to exclude posts from certain category
- list child page items (1 level with meta keys)
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Duplicated posts on category page
- Query a WordPress page by its title (which has a parent page)
- query_posts() vs get_posts() multiple loops [duplicate]
- Order by category titles
- post_parent array doesn’t work
- How to get post ID in a Page?
- 3 random images from custom post type, each in a div with a diffrent class
- How to place an image after Nth number of posts in query_posts
- Related Posts: Notice: Undefined offset: 0
- Can’t get pagination to work for sticky posts only
- show x number of posts from y category on homepage
- How to Show Comment Count on Related Posts?
- Loop through posts of only 2 statuses
- How can I show only 5 posts from the relationship?
- Loop through custom taxanomy in post and display custom fields from posts
- Make query_post category name dynamic
- How can I list posts with different formats depending on order?
- query_posts orderby postmeta [closed]
- WordPress Query based on random taxonomy
- Displaying and Querying Posts with Featured image
- View Achive with Category Filter, but Page per post not working
- Sort post by custom field numeric value
- grab neighboring content in a query
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Having an issue doing a WP_Query with post_content and category__and
- How to put posts in pages using query posts
- Query add html after set amount of posts?
- Custom loop off by one post
- How to setup blog page to render blog posts minus afew categories
- How to get max value of filtered query post
- Ordering of posts, 2020 Year showing as next event when should be last
- Problem with my loops
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Use special template for the first post in the loop
- How to display most popular post by views count in WordPress?
- show latest authors blog post
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- query multiple posts by id using a string parameter, not array()
- Query posts in a category and include only one post per author?