so I am thinking your $arg would be:
$args = array(
'numberposts' => $portfolio_items,
'order' => $portfolio_sort,
'orderby' => 'date',
'post_type' => array('portfolios'),
'offset' => $offset,
'exclude' => '1,2',
);
And that would exclude post 1 and 2.
But a better option that you should do, is to just create a featured category for your work. And then only display the posts that are in the featured category. That way you wouldn’t have to hand type in post ID’s everytime you want them excluded in your loop.
Related Posts:
- Retrieving 3 latest post from each of 5 different custom post types
- Query for posts in 2 taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- pagination not working for category.php (custom post types in categories)
- Pagination not working on custom query on a page
- postsperpage value not being applied
- Custom Post Type Query W/Category Dropdown
- display news with pictures 3 small and one large (loop)
- How do I correctly query posts from a post ID?
- How do you get the count of posts in an archive page?
- Custom post type archive 404’s with paginate_links
- Display Custom Post Type Fields
- How to get the parent’s taxonomy?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- Query not returning CPT posts
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Unable to display multiple post types in same query (WPML WP_Query)
- exclude custom post type by meta key in wp_query
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Impossible to get Attachments Outside WordPress?
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Unable to get post content from custom post type loop
- Lists Posts from CPT that match the Title of the Page
- Help Structuring Query for Archive Pages
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- wp_query to find posts by year and month
- Remove duplicated values from a loop
- Custom Post Type Loop within Shortcode
- How to connect two custom post types with nested loops
- Query custom post type in the loop
- Display CPT posts based on specific taxonomy
- Query/list all terms and their custom post count
- Show one item per category of a custom post type
- Custom loop with multiple taxonomy queries
- Get latest 3 posts from multiple CPT in one query
- Show a Category X’s custom post type on Category X archive page?
- Polylang non-default language ignores tags in WP_Query
- Problem: wp_query outputs all images on site
- Different Ways to Query Custom Post Types?
- Listing all term items alphabetically / sorting loop
- How to display Related Posts based on number of taxonomy terms matched
- Wrapping x posts in html without leaving empty html
- How to make WP_Query not to show irrelevant posts?
- Loop for custom post types filtered by a taxonomy
- Multiple Custom Post Type queries, how to DRY it up
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- Loop through posts of only 2 statuses
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- display posts of custom post type with custom taxonomy
- Trying to add a class to post links
- Can’t change posts per page in WordPress Post Type Query
- List all Custom Post Type posts excluding certain Taxnomy term
- Query all post types but limit to parents
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- How do I list a custom field and custom taxonomies for each result in a loop?
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- WP query_posts group by meta field related
- Page that lists publications by classifying them by taxonomy
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- custom post type and a “sticky” position taxonomy
- Filtering posts based on three taxonomies
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- SEARCH QUERIES – REVERSE OUTPUT
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Staggering featured post using ‘sticky’
- Query the title of the page to show posts with matching category in the loop
- WordPress query in which condition uses custom field
- Error in WP Query. If variable is empty it is displaying previous post value
- get_post_meta for Custom Post Type ( CPT )
- Main site single-property.php design, as homepage of a multisite
- How To Loop Through list with Custom Post Types
- Custom Post Type + Category archive
- WordPress custom post type
- Post data in separate divs with incrementing class using WP_Query
- Custom Query With Multiple Meta Key Value
- Fallback if statement based on the number filtered from it
- next_posts_link returns same content of 1st page
- Custom loop won’t work, can’t find problem
- Custom post-type’s pagination not working in category.php
- display custom post type from register taxonomy
- Custom post type and have_posts() return empty result
- show custom post’s post in two different divs [duplicate]
- Display ACF object field data using Elementor Custom Query
- Assign a tag to custom post type using a query
- How to insert a post from a different post type after every nth post
- Complex Custom Loop with Includes