Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Displaying Category Headings on all Category Archive Pages in Genesis

May 2, 2014 1 Comment

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.

genesis-category-heading

 

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' );

 

The action will place the archive heading just outside of the loop.

genesis-category-before-loop

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.

Gist.

Cats: WordPress

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Discuss

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls
Get DesktopServer

Lynda

Lynda.com Online Training Videos

TreeHouse

smlinks

Learn WordPress
osx-modify-shell-path

How to Add to the Shell Path in macOS Big Sur and Catalina using Terminal

October 19, 2019

virtual-hosts osx 10.10 yosemite

Set up Virtual Hosts on macOS Catalina 10.15 in Apache

October 19, 2019

Installing Homebrew on macOS Catalina 10.15, Package Manager for Linux Apps

October 18, 2019

Where is the bash shell in macos Catalina?

October 12, 2019

Refine your search

  • All
  • Modules
  • Themes
  • Documentation
  • Forums & Issues
  • Groups

RSS ars technica

  • Google hits back after Apple exec says AI is hurting search
  • Apple: “Hundreds of millions to billions” lost without App Store commissions
  • Matter update may finally take the tedium out of setting up your smart home
  • Cue: Apple will add AI search in mobile Safari, challenging Google
  • Apps like Kindle are already taking advantage of court-mandated iOS App Store changes

RSS mac surfer

  • Tot is new text editor for Mac, iPhone, and iPad focused on constraints and ease of use
  • TiPbITS: Google Drive Sorting Can Hide New Documents
  • How to take a screenshot on a MacBook Pro
  • How To Create Simple Animation With Mac Keynote
  • Last Week on My Mac: Virus pandemics

Donate

Copyright © 2025· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2025 · gee on Genesis Framework · WordPress · Log in