• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

How To Show Only Titles on Archive Pages In Genesis

This tutorial includes some PHP code which creates a custom archive page template in Genesis.

The reason i wrote this post is because of this question on the forums which i wanted to answer and share with you:

I want to show only my post titles on all of my archive and category pages including my home page. I don’t want to show the full content or the excerpt, just the post titles, dates, category, etc. Does anybody know how to fully remove the excerpt and just show post titles on archive pages?

My solution produces this result:

title only

I tested this solution on the Executive Pro child theme by StudioPress which is an excellent theme to customize.

The Code

Installing The Code

Simply copy the PHP code from the view raw link in the Gist and paste it into a new file named archive.php using a code editor like Notepad++.

You can then upload the file to the root directory of your child themes folder.

Display Only Titles On Home Page

There’s at least 2 ways you can display only entry titles on your home page in Genesis.

1. You can also copy this file and rename it home.php if you want to only display entry titles on your home page as well. If your theme includes a front-page.php file, make sure you remove it as it will over ride your home.php file.

2. You can use the WordPress function name template_include with a conditional tag for your home page in a custom function in your child themes functions.php file to load any template file on your home page conditionally.

This solution fires before the normal process that WordPress uses to load different files based on the default template hierarchy over riding any home.php or front-page.php file included in your themes root directory.

The above PHP code works in any themes functions file.

Remove Post Info Entry Meta From Entry Header

You may also need to add this CSS to your style.css file if you want to remove the entry meta from the entry header on your home, archive and blog pages.

.home .entry-header .entry-meta,
.archive .entry-header .entry-meta,
.page-template-page_blog-php .entry-header .entry-meta {
display: none;
}

Related Posts

  • List Titles Only On Search Results Page
  • List All Post Titles Only in Genesis
  • Twenty Fourteen Theme: Show Only Post Titles On Archive Pages

Reader Interactions

Comments

  1. serge prengel says

    April 30, 2017 at 11:50 am

    Thanks, Brad. The “archive.php” works on my site with the Wintersong child theme. I have a few questions about further customizing it, and a general question about how that may be affected by future updates.

    1. I would like to further customize the “category” archive page to show the title of the post and the featured image. I have removed the line about “remove post image”, and the image now shows up, under the title. I would like it to show to the left of the title. Is there a way to do this? Ideally, I would also like it to be smaller than the smaller size option on the customizer. Is there a way to do these two things?

    2. My other question is about what happens to the file “archive.php” after the Genesis theme, or the child theme, get updated. Will “archive.php” remain unaffected, or is there something I must do after an update?

    Log in to Reply
    • Brad Dalton says

      April 30, 2017 at 12:13 pm

      Hello Serge

      1. You need custom code for that. I assume you want the image the same height as the title and inline with the title floated left?

      Add this code to the archive.php file

      remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
      add_action( 'genesis_entry_content', 'genesis_do_post_title', 8 );

      And this to functions.php

      add_image_size( 'inline-image', 36, 36, TRUE );

      You can then regenerate thumbnails to create a new image this size from existing featured images.

      Result:


      2. The archive.php file is a custom file so you will need to copy it over to a new child theme if you update the child theme. Child themes are not auto updated so the only way to update your child theme is to remove the old version and install the new one.

      Updating Genesis will not affect your child theme. I suggest you keep a local copy of your child theme so you have backup.

      Log in to Reply
      • prngl says

        April 30, 2017 at 3:39 pm

        Thanks. I see your picture of what it should look like, and that’s it. I’m not quite there yet:

        The first part, the code for archive.php, works for me.

        But the change in functions.php is not working for me. The images stay the same size (I did regenerate images with the “regenerate thumbnails” plugin and deleted browser history, so that shouldn’t be the issue).

        Also: I am not able to resize the font size of the title (I have Genesis Design Palette Pro, but do not see where I could change the type for archives).

        Log in to Reply
        • prngl says

          May 1, 2017 at 4:56 am

          Regarding the comment I left on 4/30/17 at 3:39:

          I figured out how to change the size of the featured image (changing the media settings of smallest image size)

          BUT I am still not able to resize the font size of the title (I have Genesis Design Palette Pro, but do not see where I could change the type for archives).

          Log in to Reply
          • Brad Dalton says

            May 1, 2017 at 5:19 am

            You can change the entry title size using CSS.

            .entry-title {
                font-size: 36px;
            }

            I do not support the use of the Genesis Design Palette Pro plugin. It will only complicate things.

        • Brad Dalton says

          May 1, 2017 at 5:18 am

          You need to change the size in the Genesis > Theme Settings > Content Archive > Featured image settings.

          Log in to Reply
    • prngl says

      April 30, 2017 at 3:40 pm

      I had posted this without realizing it showed my name instead of the nickname. If possible, I would like to delete the post and re-enter it under my nickname.
      🙂

      Log in to Reply
  2. Ozgur says

    July 8, 2014 at 8:23 pm

    It works perfectly, thank you so much. Is it possible to group posts by tag on this category archive pages?

    Log in to Reply
    • Brad Dalton says

      July 8, 2014 at 8:25 pm

      Yes but how do you want to display them?

      Log in to Reply
      • Ozgur says

        July 8, 2014 at 9:01 pm

        This code only show post titles, for e.g.:

        — Post1 title
        — Post2 title
        — Post3 title
        — Post4 title

        I want to add one step more and make a group by tags for that category. And it shows like this:

        Tag1 Name
        — Post1 title
        — Post2 title

        Tag2 Name
        — Post3 title
        — Post4 title

        Log in to Reply
        • Brad Dalton says

          July 8, 2014 at 9:07 pm

          You need a custom loop for that using new WP_Query

          That’s one way to do it and there are others.

          Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.