2013-11-16

Did you ever wanted to distinguish your newest post in front of the other posts in the list ? This snippet will allow you to make your latest post look different (in any category) and to dinstinct itself from the rest.

Where to copy/paste this code? The best way to customize a theme in WordPress is to create a child theme. Everything you need to know about child theme creation in Customizr here

1. Filtering

First we need to add additional css classes for our latest post. We can do this by adding this short function in the function.php file of the child theme:

We now have new .latest class that we can use to style our latest post.

 

 2. Styling

The following code should be copied into the custom css section or in style.css of your child theme. For this example, we will make our latest post to distinguish  itself with few elements in crimson color:

Of course, all custom css styling can be applied, for all entry elements, like entry-title, entry-summary and entry-meta, e.g. tag and category links.

The post Emphasize latest post on the list appeared first on Themes & Co.

Show more