Create Custom Category Archive Page Template In Genesis

The easiest way to create custom category archive pages is to copy an existing file from your parent theme and rename it. You will then need to modify the code in the file according to your own requirements.

Simply copy either the archive.php or category.php file from your parent theme and paste it into your child themes folder then change the file name if needed.

If you only want a custom category page for one category, you have 2 choices.

Use the category slug or i.d like this for the file name and WordPress will load the template according to the Template Hierarchy :

category-example.php
category-1.php

The same applies for tag and author archives.

If you want to create a custom category page for all categories, simply name your file:

category.php

For all archives including categories, tags and author archives, name your file:

archive.php

All files should be uploaded to your child themes root directory unless your theme uses a specific folder to store templates.

Genesis archive.php example

Upload the file from the download folder to your child themes root directory.

Download Template

Here’s what the above code generates in the Enterprise Pro child theme by StudioPress as an example:

custom archive file template

  1. Entry Header – Entry Title
  2. Entry Header – Entry Meta (Post Info)
  3. Featured Image – Post Thumbnail
  4. Post Excerpt
  5. Entry Footer – Entry Meta

The template code shows you how easy it is to add and remove both add_actions and remove_actions to customize the output of your different archive page elements.

Styling

You can then use the page i.d to style your archives differently or add a custom body class like this directly to your custom archive file or conditionally from your functions file:

In Genesis, you can add the code to generate a custom body class directly to your archive file otherwise you can add it to your child themes functions file with a conditional tag after the function when using other themes.

Archive Type Templates For Genesis


Comments

15 responses to “Create Custom Category Archive Page Template In Genesis”

  1. Stephanie Heese Avatar
    Stephanie Heese

    Hello! Thank you for your fabulous tutorials! I have an issue wherein the category and tag archive pages in my Genesis Sample theme are suddenly showing white/blank screens. I got to this tutorial through searching, and I wonder if I would copy the archive.php file from the Genesis main folder in lib->structure and plop that copy into my Genesis Sample folder. If that makes sense, would I put archive.php in Genesis Sample’s lib->structure folder or its root? Currently, Genesis Sample only has footer.php, header.php, and sidebar.php in the lib->structure folder. I don’t see any archive or category files whatsoever.

    I am hoping this might somehow resolve the white screen problem. I haven’t been able to find any fix for it for days.

    1. Hello Stephanie. Are you a premium member? Support is only provided to paid members.

  2. Hello Brad, thanks for your tips.
    I have a question: how can made a custom archive page where the entry-title appears aligned to the right of the featured image, similar to this: https://i.imgur.com/UEfAgVm.jpg

    Thank you very much
    Manny

  3. Hi, Brad Thanks a lot for all the useful codes, tips and tricks you have been providing for us, non-techies.
    It’s clear that you know what you are talking about and that leads me to ask a question if you don’t mind, please.
    I have been trying to figure out how to delete the post content (post title, thumbnails picture, content etc) from the archive pages (category and tag pages) on Genesis Child themes (News Pro). I’m hoping to be able to only display the category description and the category title on all the archive pages. Do you think it’s possible with Genesis Child themes?
    To make it more clear I am also leaving the link of one of my categories below. https://bestellipticalmachinehut.com/precor/

    These are the content that I am struggling to remove from the archive pages
    #1 Post picture
    #2 Post Title
    #3 Post content
    #4 Where it says “FILED UNDER”
    #5 The horizontal “Dotted line”

    Basically, I am trying to delete everything from the archive pages (all category and tag pages) except the category description and the category title (heading).

    I would really appreciate any help man!
    Thanks again for the Tutorials

      1. Thanks for replying back Brad. I see your code keeps the post title and date but is it possible to delete the post title and data (everything related to the post) from the archive pages but keep the archive title and description?
        Thanks

  4. Hi Brad,
    I have a question: how to place the description of the category in the end of a category page (instead in the beginning), in the Genesis Metro Pro? I am using the Yoast SEO plugin and there is a space to enter the description “Archive Intro Text”.
    I need the listings in the beginning.
    If you place a description in the Genesis area, it’s not readable by visitors and Google. It doesn’t show in the “page source”

    OR, if you place the category description in the Genesis area, how simply to show this description to Google that is will show in the “page source”? I really don’t care if site visitors will see it, it’s only for SEO.

    Thank you very much.

    1. Brad Dalton Avatar
      Brad Dalton

      There’s a Archive Intro Text field & category description field Genesis generates regardless of whether you use a SEO plugin.

      What version of Genesis are you using?

      The category description is not prominent by default; however, some themes may show it.

      1. Genesis version 2.1.2

        1. Brad Dalton Avatar
          Brad Dalton

          You can re-position the description to another hook position conditionally using PHP code.

          I would use the loop_end or genesis_after_loop hook.

          You’ll need to find the hook in Genesis.

          Or you could filter it as another option.

          1. Thank you!!!!

          2. Brad Dalton Avatar
            Brad Dalton

            Here’s the code from genesis > lib > structure > archive.php you can modify to re-position the title or description

Leave a Reply

Join 5000+ Followers

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