Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can we add # before each tag with both the_tags( ) and wp_tag_cloud( )?

share|improve this question

1 Answer 1

You will have to use your own custom function, the_tags( ) doesn't allow you to do that. You could create a function like this, using get_the_tags, and format your html as you prefer :

function hashtags() {
    $posttags = get_the_tags();
    if ($posttags) {
        foreach($posttags as $tag) {
            echo '<a href="' . get_tag_link($tag->term_id) . '">#' . $tag->name . '</a> '; 
        }
    }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.