I hope you are well today and thank you for your question.
To achieve this you have to overwrite following theme file in Jevelin child theme and change the code on line number 491
I tried editing, I added this to get the post id’s from the current category:
$taxcategory = get_the_category(); $idcategory = $taxcategory->cat_ID; $post_ids_related = get_posts(array( 'numberposts' => -1, // get all posts. 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $idcategory, ), ), 'fields' => 'ids', // Only get post IDs ));
And then changed the following to:
$portfolio_items = new WP_Query(array( 'post_type' => 'fw-portfolio', 'posts_per_page' => 4, 'orderby' => 'rand', 'post_status' => 'publish', 'post__in' => $post_ids_related ));
but it doesn’t seem to work… Help?
Instead of get_the_category you have to use get_the_terms function and also use post_type argument in both the queries.
Developing custom code for custom functionality is beyond the scope of support that we provide here. Please see https://themeforest.net/item/jevelin-multipurpose-premium-responsive-wordpress-theme/14728833/support
If you are not a developer then you can consider hiring a developer to develop it for you. You can hire a developer from any freelance site. Shufflehound recommends the developer https://www.upwork.com/freelancers/~011652ffec8865c6d5