Forums
Home / Developing with WordPress / Adding Class
(@ragnar22)
7 years, 10 months ago
Hi guys i have question..
how to do in wordpress to put an individual CLASS in a “the_title()” with a 5 post title within on it.?
thanks..
(@t-p)
I’m not sure if I understand your question.
If you you want to add a span class in the post title, try using a filter on the_title():
function add_span($title, $id) { return $title .' <span class="title_span">' .get_post_meta($post_id, $key, $single) ."</span>"; } add_filter('the_title', 'add_span', 10, 2);
hi @t-p,, thanks for the reply..i found already a solution..by using this code
id=”post-<?php the_ID(); ?>”
Glad to know it ??
thanks..hoping you can use that code someday..:)
Thanks ??