Tag Archives: css class

alternative-post-coloring

Snippet: Add “alt” CSS Class to Alternative Posts

If you want to have different look and feel for post one after the another. This snippet will let do that quite easily. It will add “alt” class to alternative posts and you can then change, lets say, background color or border to make it different from the adjacent posts.

body class

CSS: Add custom css class in body tag

Add following code to “functions.php” Snippet

Snippet: Remove or replace one ore more classes from wordpress menu

Add following snippet to “functions.php” Snippet Result “sub-menu” class is removed from the generated navigation and “current-menu-item” class will be replaced with “current”.

first post class

Snippet: Add class to first post in the loop

Add following snippet to “functions.php” Snippet Result It will add “first-post” class to first post of the every post loop.

Snippet: Add a custom class to the next and previous links

Add following snippet to “functions.php” Snippet

Snippet: Add parent page slug to body_class

Add following snippet to “functions.php” Snippet

CSS: Add first and last menu item class to menus

Navigation menus are important part any website. If you want to apply a css class to the first and last part of menu item then here is the code snippet.