Today in Series Twenty Seventeen we’re going to display our WordPress posts by Post Titles and Tags. We’ve covered displaying Post Excerpts before, but I’ve always been a Titles-Only Display kind of guy.
We begin by adding a new WordPress Template Part, content-title.php.
We’ll be calling it from index.php, archive.php, and search.php for a consistent look across all Post List pages.
Not much to our Post Title display template content-title.php as you can see. There is, however, a new nixmash_post_list_tags($post) function to display to tags.
Here’s the function we added to [theme]/inc/template-functions.php where we spit out the post’s tags just the way we want’em.
With the final result you saw on the opening screenshot and in the following HTML.