Put Post Tags After the_content

I can’t figure out what’s going on with this filter.

function delayedtags($content) {
            
            $fullcontent = $content .'<div>'. the_tags( '<ul><li>', '</li><li>', '</li></ul>' ) .'</div>';
        return $fullcontent;
    }
add_filter('the_content', 'delayedtags');

I just want to put a div layer with the post tags at the end of the content, but this gets rid of the div and just puts the tags before the content, instead of after it.

But doing

$fullcontent = $content .‘hello’;

Will put hello after the content. Guess can’t use function?

all feedback appreciated

Actually, figured it out. the_tags function echos, so it had to be enclosed with ob.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.