WordPress Genesis Framework – Showing a List of Post Titles in Category View

Today I learned… how to customize the “Category” view in WordPress (Genesis framework) to show just the post titles as ordinary links in a list.

I really like the way posts of a category are displayed on DailyBlogTips. Each post gets a bullet in a simple unordered list.

DailyBlogTips’s category view shows just the post titles in an unordered list.

By default, WordPress (and Genesis) gives you two options for displaying posts by category: either their full form one after another (do not want), or a truncated version with the post title and excerpt (also do not want).

A solution in which the titles were rendered as <a hrefs> between <li></li> tags required modifying the loop when on a Category page.

Please note that this code requires a theme built on the Genesis framework, though it should not be hard to modify the hooks to suit your framework if you know your way around a bit.

Copy the contents of functions.php into your child theme’s functions.php file.

Here’s what this is doing, in English:

When the current page is ‘Categories’ (Line 9), don’t do the usual genesis_loop (Line 13). Instead, do this custom loop (Line 14) called mjg_custom_loop.

Over in mjg_custom_loop, create a new unordered list (Line 21) and for each post (Line 22), echo its permalink and its name into a set of <li> </li> tags (Line 24).

The contents of style.css will probably need to be customized to fit your site’s design, but hopefully this is enough to get you through the hardest part which is customizing the loop on the category page.

Here is how it looks on the site:

Titles-only Category view on TowerSecrets.com

9 thoughts on “WordPress Genesis Framework – Showing a List of Post Titles in Category View”

  1. Thanks for this great tips,
    Is there any tips if i want to display thumbnail images on list of posts titles in categories archieve?


  2. This helped, thanks! Haven’t used this kind of code for a couple of years so nice to find one to do this on a current project.

    I couldn’t get the .category-post-title-list CSS to work — although I ended up putting my own cat-page-post class with the LI tag, and updating the CSS for that class… that worked fine.

  3. This worked for me…thanks.. Any suggestions on how to get this to work on the main blog page as well? I would really like my main blog page to look the same with all posts listed like this.

Leave a Reply

Your email address will not be published. Required fields are marked *