• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Displaying Category Headings on all Category Archive Pages in Genesis

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Displaying Category Headings on all Category Archive Pages in Genesis

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 9 years, 9 months ago by Tom.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 23, 2016 at 5:46 pm #179759
    thuan
    Participant

    In a Genesis WordPress theme you can add in a headline to display for a Category archive page, but this headline only appears on the initial category archive page, so if pagination exists for subsequent archive pages then other pages do not have the title rendered.

    To get around this issue if you have pagination on your category archives the problem is better solved with a function in your themes function.php file

    function themeprefix_category_header() {
    if ( is_category() )  {
    		echo '<h1 class="archive-title">';
    		echo single_cat_title();
    		echo '</h1>';
    	}
    }
    add_action( 'genesis_before_loop' , 'themeprefix_category_header' );

    The function above will only run if the content is a category page and then render the actual category title in h1 tags with a class of archive-title set to it. It will display on all the same category archive pages.

    If you wanted something other than the category title you drop the single_cat_title for something else…

    function themeprefix_category_header() {
    if ( is_category() )  {
    	echo '<h1 class="archive-title">Your Heading Here</h1>';
    	}
    }
    add_action( 'genesis_before_loop' , 'themeprefix_category_header' );

    This can also be applied to tags

    function themeprefix_tag_header() {
    if ( is_tag() )  {
    		echo '<h1 class="archive-title">';
    		echo single_tag_title();
    		echo '</h1>';
    	}
    }
    add_action( 'genesis_before_loop' , 'themeprefix_tag_header' );

    A lot of sites won’t have a need for this but when those archives build over time or a small amount of posts per archive page is applied its a handy setting to add.


    House Việt Nam

    February 24, 2016 at 11:55 pm #179856
    Tom
    Participant

    Source: http://wpbeaches.com/displaying-category-headings-category-archive-pages-genesis/


    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble