Display all taxonomy terms, add class if term applies to current post

I was able to put this together from a similar question I found. If anyone else needs it: <?php $terms = get_terms( array( ‘taxonomy’ => ‘features’, ‘hide_empty’ => false ) ); if (!empty($terms) && ! is_wp_error( $terms )) { echo ‘<section>’; foreach ($terms as $term) { $class = has_term( $term->term_id, ‘features’ ) ? ‘active’ : … Read more

Ajax Custom Post Filter is not filtering

How to make your AJAX filter works properly: As I said in the comments, add the data-category attribute to the <a> having the CSS class js-filter-item in the foreach loop in your archive-projetos.php template: // * Wrapped for brevity. foreach ( $categories as $cat ) : ?> <li><a class=”js-filter-item” href=”<?= get_category_link( $cat->term_id ); ?>” data-category=”<?= … Read more