Custom Taxonomy Page

Depending on the hierarchy of WordPress templates, you can create a template: category-$slug.php, in your case, it will be: category-destinations.php (to mention that the slug must be the same name) . So this template will have the priority if we click on the link category destinations. I used Twenty Nineteen theme. Templete named : category-destinations.php … Read more

Display custom posts, ordered by most commented, without duplicates

Currently, it looks like you are looping through comments and then querying the posts from there. Could you use the comment_count order by parameter directly in the posts query itself? For example: <?php $post_args = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 1, ‘orderby’ => ‘comment_count’ ); $posts = get_posts($post_args); foreach ($posts as $post) : setup_postdata($post); … Read more