Tag Info

Hot answers tagged


You could use the slug of each term as class name (and do the styling via CSS) <?php echo '<div class="col-lg-3 ' . $term->slug . '">'; // $term->slug is the class name echo '<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>'; echo '</div>'; ?> If you want to use dynamic terms and colors I recommend ...


If I understood correctly, you want a archive template for terms of core tag taxonomy that includes only your portfolio custom post type. The best way is to use the pre_get_posts action hook to set post_type argument of the query to 'portfolio': add_action('pre_get_posts', 'query_post_type'); function query_post_type($query) { //Limit to main query, tag ...

Only top voted, non community-wiki answers of a minimum length are eligible