Twenty Fourteen Theme: Show Only Post Titles On Archive Pages

This question was asked on the forums recently which i’ll answer with one solution i think is the best:

I’m using the Twenty Fourteen theme and think it’s stupid to show full posts in the Archives section. I want just the titles to be displayed for easier navigation. Even removing the dates would be nice. (I’ve already done so for individual posts but the Archives section still says May 2014.) This is minor though. The main thing I’d like to know is how to only display the title.

I’ve looked at the archive.php file (included below) but don’t know php and have no idea what to do. The advice I’ve found using Google is outdated and the code samples don’t match mine. Please o’ gracious lords of the internet, tell me what needs to be changed so my site can suck a little less.

Here’s what my solution produces:

titles only

1. Create a child theme for Twenty Fourteen

The first step is to create a child theme which we’ll use to copy over files from the parent them in order to avoid losing the changes when the parent theme updates.

2. Copy Files From Parent to Child Theme

Copy over the content.php file and the category.php file if you only want to display post entry titles on all category archives.

If you also want to display post titles only on other archives like author and tag archive pages, copy over those files as well.

3. Modify File Names & Code

Rename the content.php file to content-titles.php and then remove all the code in the file leaving only whats needed to display your entry titles. Here’s the result showing the screenshot from my local installation, followed by the code.

post titles only twenty fourteen category archive page

And here’s the code for your content-titles.php file.

4. Edit Get Template Part Name In Files

The final step is to open your category.php file which you copied over to your child theme and find this line of code:

get_template_part( 'content', get_post_format() );

And change it to this:

get_template_part( 'content', 'titles' );

You can read more about get_template_part on the WordPress.org Codex however what it basically does is include the file named content-titles.php in the file you include it in which in this case is the category.php archive page template.

Titles Only On Other Archives

Simply change the get_template_part() name to in any other archive type files you copy over to your child theme and they will also only display the post entry titles.

get_template_part( 'content', 'titles' );

Got a better solution for showing post titles only on archive pages in the Twenty Fourteen theme?

If you’re interested in learning more about why Genesis is the most popular premium theme framework, click the link below in the related posts to see how its done in StudioPress themes. Far cleaner, easier and faster in my opinion.

Related Posts


Comments

4 responses to “Twenty Fourteen Theme: Show Only Post Titles On Archive Pages”

  1. Where am I wrong? I have copied your content-titles.php file in my child theme folder, but the whole articles are still there instead of just the titles…

    1. Brad Dalton Avatar
      Brad Dalton

      Hello Fabio

  2. Kim Noeth Avatar
    Kim Noeth

    I have a question about the twenty fourteen theme. I customized this theme so that I have a grid displaying with my 6 static posts in the boxes on the home page and then a static home page below that grid as opposed to current posts. I do not know how to create a separate page that will allow me to display written current Blog posts and not effect the 6 static posts I have displaying on my home page.
    Is there a way to create a page and have only the posts within that category display on that page?

    1. Brad Dalton Avatar
      Brad Dalton

      Kim

      Its a category archive which is already included in the theme.

      Or you can create a custom loop using WP_Query

      I’m happy to help you with this as long as you can clarify exactly what you want to do.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.