• Resolved ragnar22

    (@ragnar22)


    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..

    • This topic was modified 7 years, 10 months ago by ragnar22.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@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);
    Thread Starter ragnar22

    (@ragnar22)

    hi @t-p,, thanks for the reply..i found already a solution..by using this code

    id=”post-<?php the_ID(); ?>”

    Moderator t-p

    (@t-p)

    Glad to know it ??

    Thread Starter ragnar22

    (@ragnar22)

    thanks..hoping you can use that code someday..:)

    Moderator t-p

    (@t-p)

    Thanks ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding Class’ is closed to new replies.