Instantly share code, notes, and snippets.

@thanh4890 /loop-blog.md Secret
Created Mar 28, 2016

Embed
What would you like to do?

In your theme directory open this file: templates/loop-blog.php

Find the line 40, it looks like:

<a class="entry-categories" href="<?php echo esc_url( get_category_link( $first_cat->term_id ) ); ?>"><?php echo esc_html( $first_cat->name ); ?></a>

Replace it by:

<a class="entry-categories category-<?php echo $first_cat->term_id; ?>" href="<?php echo esc_url( get_category_link( $first_cat->term_id ) ); ?>"><?php echo esc_html( $first_cat->name ); ?></a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment