You can try making the $args array more specific with:
$args = array(
'post_type' => 'portfolio',
'tax_query' => array(
array(
'taxonomy' => 'locations',
'field' => 'slug',
'terms' => 'paris'
)
)
);
Grabbed this snippet similar to one on the WP Query page in the codex. Also, this is assuming that your custom post type is called “portfolio” and you have a custom taxonomy, “locations” and the term “paris”. I say this because your question above says:
I am trying the following code, yet it gives me the ALL the posts of
the taxonomy ‘portfolio’ and not just of one term:
So “portfolio” is your custom post type, correct? Anyway, let us know if you find the problem. Good luck!
Related Posts:
- Set terms in a custom post
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How are terms connected with posts in database?
- Importing data from spreadsheet into wordpress DB, along with custom taxonomies and their terms
- get_terms parent for current product only
- deleting terms programmatically
- Adding Multiple Values to a Post Meta Key
- Remove custom posts that match taxonomy value
- Using Custom Posts with Metaboxes and Drop-downs
- Avoid duplicate post from same Taxonomy
- How to display data in archive page?
- Setting posts_per_page for taxonomy term template
- Duplicate Custom Post Type and Taxonomy Slug
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- How to display posts via custom taxonomy terms using checkboxes?
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Loop parent terms {display posts} AND loop child terms {display posts}
- relating business and products with custom taxonomy?
- How To Use Custom Tax of a Post Type
- How to output all taxonomy links from a custom post type in a menu?
- Show post count in custom taxonomy page
- Loop through taxonomies and loop through their terms (Newbie question)
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Multiple Custom Post Type loop logic
- How to list all names and descriptions of a custom taxonomy
- 404 for some custom taxonomy not ALL taxonomy
- Displaying Results From Custom Taxonomy Query
- How to get all the terms of a post
- Special Query: Title, Terms, Content – %LIKE%
- Taxonomy Category category.php not working
- Difference between modified post and new post
- Displaying dynamic content (blog posts/portfolio) on a static homepage and keep the blog post styles
- How to use Categories of custom post type
- issue with saving custom metaboxes fields
- Filter By Term Not Working – Custom Post Type
- Append a random string to a post permalink
- single- and archive- templates not being applied to custom post types, not even after flushing permalinks
- How to get post count including nested categories
- Custom Taxonomy From Database
- Creating widget – ask for selecting a post in the admin panel
- WordPress search for specific Post Type
- Show Posts By Custom Field
- issue in wordpress auto delete post and redirect to another 1
- Static text above category page
- How can you control what a user is allowed to post in the backend?
- wp query custom orderby not custom field
- Custom Post Type doesn’t use single.php or single-{custom_post_type}.php
- Customizing individual images on posts
- Hook To Get All Posts Deleted
- How to show content of specific item on the same page?
- How to retrieve custom field values and save again as array
- Meta boxes not saving
- Custom Select Query pagination not working properly
- Custom Single Post Type not referring to single-post-type.php File
- Custom URL Structure for posts with subcategories
- Help with a function that will place a map pin for all posts
- How to display term in archive page?
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Customize search results to include custom posts and display in a specific template page
- How can add posts without category into category
- Custom permalink based on custom post type fields
- How to modify specific parts of a post content in WordPress
- Include post on external custom site
- How to show the posts list into a static page? Problems to use the loop into a static page
- Get new post meta data when (custom) post is saved
- Run Jquery Script after delete post in front end
- How do I control the fallback query after the original query returned cero posts?
- Checking if some condition is matched before inserting post into database
- Adding The Post Template Dropdown to WP-Admin
- wordpress paginate, link to the right page
- Allow users to create their own page/s
- “Current” class on a singular page menu item with custom post types?
- Custom terms in custom category taxonomy
- Loop through posts by each term and exclude duplicate posts assigned to several terms
- Given two custom post types: Automatically add meta fields from one custom post type to another
- How to only allow post to be deleted if custom field doesn’t exist
- Display metabox with date
- Multiple loops on a Search result page?
- Show a Category Specific Info Box
- Successive creation of over 1000 posts causes 404?
- Make a custom URL and link to custom Template
- Delete Term via edit-tags.php
- How can i retrive the movies, trailers, news in a single page using search
- Custom Post Title as search term
- Add default content to post (for specific category)
- How can I allow users (subscribers) to download selected posts into a single PDF? (RESOLVED)
- Setting default category for display
- Choose options via url
- Custom Post Type Pagination 404 Error (if paged>=2) [duplicate]
- retrieve post slug by post_tags taxonomy
- adding custom meta as well as looping through posts
- Display ONLY Latest Post From Several Categories
- get post custom value
- WordPress strips some attributes for author posts
- First Custom Post Custom Fields Empty After New Custom Post
- Automatically delete default posts and pages on theme install?
- Best way to enable sorting by 3 criteria on a page of listings
- WordPress 3.2 – Problem with WYSIWYG editors in a custom post type?
- How to Do Custom Fields to Output a Definition List