I am currently working on the code below and I’d like to add a custom class name. I’m not familiar with PHP.
How can I add a custom CSS class name?
<?php next_posts_link('Older Posts'); ?>
<?php previous_posts_link('Newer Posts'); ?>
I am currently working on the code below and I’d like to add a custom class name. I’m not familiar with PHP.
How can I add a custom CSS class name?
<?php next_posts_link('Older Posts'); ?>
<?php previous_posts_link('Newer Posts'); ?>
You must be logged in to post a comment.
Add this in functions.php of your theme. It will add class “styled-button” to those links.
If you would like to differ them, then use:
I am not familiar with WordPress, but according to the Codex, there is no way to specify the class attributes in these function calls:
What you can do is
str_replace
the html returned by these functions, e.g.In case these functions already return a link with a class attribute, use a regular expression or DOM.