display specific category on page

Just use WP_QUERY to achieve that. <?php if ( have_posts() ) : ?> <header class=”page-header” style=”animation-delay: 0.3s; animation-duration: 2s;”> <?php the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ ); the_archive_description( ‘<div class=”taxonomy-description”>’, ‘</div>’ ); ?> </header> <div id=”archive-blog-wrapper” class=”archive-blog-wrapper three-columns”> <?php /* Start the Loop */ ?> <?php //set up a new query $category_query=new wp_query( array( ‘cat’ => ‘put … Read more

Custom tax_query filter not working for Woocommerce product categories

I figured out what the issue was. The page was displaying categories/subcategories and not the items themselves. This meant that woocommerce_product_subcategories() was the one filtering and that uses a different hook. Here is what I added to my functions.php file. add_filter( ‘get_terms’, ‘get_subcategory_terms’, 10, 3 ); function get_subcategory_terms( $terms, $taxonomies, $args ) { $new_terms = … Read more

Posts from a category on homepage with category archieves page default css

$args = array( ‘posts_per_page’ => 5, ‘cat’ => 77 // 77 – id category ); $query = new WP_Query( $args ); // loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); echo ‘<li>’; the_post_thumbnail(); echo ‘<a href=”‘.get_permalink().'”>’ . get_the_title() . ‘</a></li>’; } } else { // posts not fount echo ‘posts not … Read more