If you are WordPress fanatics, there is some reason why we need to added extra classes on some WordPress standard code. Example we need adding extra classes and other attributes on previous_post_link() and next_post_link().
To do this WP Tricks, we need to create some function on our functions.php, the function we need is to added the code with add_filter method. Follow this tricks
add_filter('next_posts_link_attributes', 'posts_link_attributes');
add_filter('previous_posts_link_attributes', 'posts_link_attributes');
function posts_link_attributes()
{
return 'class="styled-button"';
}
What actually this snippet does is adding the html you return in the function to the anchor.
<a href="http://wptricks.net" THIS CODE WILL BE ADDED HERE>Standard Code</a>
So, on this tutorial you can add ID, classes and other attributes an anchor can have. By default it will only have the href attribute. I hope How To Added Classes on Post Navigation in WordPress is Working on you, if you have another method, please let’s me know
Thanks for WPCanyon to share this Tricks




Pingback: How to Add a Search Form on Navigation Menu Automatically « Rockinfrnz Archive
Pingback: How to Add a Search Form on Navigation Menu Automatically | WebFree.ro