• Resolved Dzoni103

    (@dzoni103)


    Hey gals/guys,

    I am having issues adding a span class to a specific word in the description..

    To call the description I would use this:
    <?php echo get_bloginfo ( 'description' ); ?>

    And what I need it to do is, when words “one” or “two” are in the description, it will wrap that word with span tags. No classes or anything just <span>.

    I’ve tried filtering for the words but it failed miserably. So I’m hoping someone can help me out.

    Cheers!

Viewing 1 replies (of 1 total)
  • Thread Starter Dzoni103

    (@dzoni103)

    I have found an alternative by using jQuery.

    $('.description h1').each(function(){
    	var word = $(this).text().replace(/word/,"<span>word</span>");
    $(this).html(word); 
    
    });

    Hope this will be of use to someone else.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding tag to specific word in description’ is closed to new replies.