Can you please help to complete the WP_Query to be able to get a list of portfolio items, which have the same category or categories assigned?
I have trouble to get it working.
<div> <div> $portfolio_items = new WP_Query(array(</div> <div> 'post_type' => 'fw-portfolio',</div> <div> 'posts_per_page' => 4,</div> <div> 'orderby' => 'rand',</div> <div> 'post_status' => 'publish',</div> <div> 'post__not_in' => array( get_the_ID() )</div> <div> ));</div> </div>
I hope you are well today and thank you for your question.
To achieve it you have to use taxonomy argument of WP_Query as described in the following page.
The portfolio category taxonomy name is fw-portfolio-category