Quantcast
Channel: Show category only if post type is post_three - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 3

Show category only if post type is post_three

$
0
0

How can i only show categories if post type is "post_three"

<aside class="sidebar"><div class="widget widget-filter"><button class="widget-title">Explore Topics</button><svg class="separator" viewBox="0 0 238 11" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><line opacity="0.3" y1="0.5" x2="101.942" y2="0.5" stroke="#3CD5AF"></line><line opacity="0.3" y1="10.5" x2="237.5" y2="10.5" stroke="#3CD5AF"></line></svg><?php              $categories = get_categories(array('type' => 'post_three','hide_empty' => true,   ) ); ?><ul class="filter-list"><?php foreach ( $categories as $category ) :                // Skip "Uncategorized" category             if ( ! empty( $categories ) ) :   ?>    <li  :class=" category == <?php echo $category->term_id; ?> ? '' : ''"><a @click="filterPosts(<?= $category->term_id; ?>)"><?= esc_html( $category->name ); ?></a></li> <?php      endif;              endforeach; ?></ul></div></aside>

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images