I have created a custom post structure to insert my portfolio items and registered a custom taxonomy called “portfolio” to categorize the posts.
The insertion goes fine, with no problems.
When i try to get this custom posts on frontpage, i want to filter them by category, but nothing happens. It keep showing me all the posts. the filter dont work.
Here is the code i use:
$projects_list = get_posts( array( 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio_category' => 7 ) );
How can i filter custom posts by custom categories?
- The topic ‘Filter custom posts by custom categories’ is closed to new replies.