I’m currently trying to style up a WordPress theme, I don’t have the greatest PHP knowledge but it’s going pretty good so far.
My one question is, how can I add classes and ID’s to hook my CSS to? For example:
The code to generate the ‘leave a comment’ link on each post is:
<?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>
I want to style this, it displays out as a link, but obviously I can’t change the CSS simply for every a tag in my main column. I need to add some sort of class to hook on to.
How do I do this?
<?php class="commentLnk" comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>
^ Guessing that isn’t right at all.
You can add your own CSS style classes to the comments link.
As explained in the WordPress API documentation for the commands_popup_link.