• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Conditional site footer in Genesis

Last Updated on August 28, 2019 Favorited: 0 times

genesis_footer_creds_text is now deprecated in Genesis 3.0.0+  You can now change it in Genesis footer setting in the Customizer.

You should set the footer_text key in your theme’s child-theme-settings.php file.

–

There is already a basic tutorial of Customizing the Site Footer in Genesis and that could be used with the combination of Genesis Shortcodes.

This tutorial provides the steps to show custom site footer and credit text in any child theme based on Genesis Framework.

The Basic

Enable it for Globally first.

We can change the entire site footer using this in functions.php (not support shortcodes)

///* Customize the entire footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'sp_custom_footer' );
function sp_custom_footer() {
	?>
	<p>&copy; 2011 <a href="/">Example LLC</a> &middot; All Rights Reserved &middot; Powered by <a href="http://wordpress.org/">WordPress</a> &middot; <a href="/wp-admin">Dashboard</a></p>
	<?php
}

or We can simply change the site footer Credit text using this in functions.php

//* Change the footer text
add_filter('genesis_footer_creds_text', 'gk_footer_creds_filter');
function gk_footer_creds_filter( $creds ) {
	$creds = '[footer_copyright first="2015"] &middot; <a href="/">GenesisKit</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
	return $creds;
}

The Conditional tag

We will use WordPress conditional tag to display a custom Credit text using this in functions.php

//* Change the footer text
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds ) {
	if ( ! is_front_page() ) {
		return;
	}
	$creds = '[footer_copyright first="2015"] &middot; <a href="/">GenesisKit</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
	return $creds;
}

replace is_front_page() with any conditional tag.

Make sure you have a global Credit text already edited using the basic mentioned at first or We can combine it in a single function.

Use this only in functions.php

add_filter('genesis_footer_creds_text', 'gk_conditional_footer_creds_filter');
function gk_conditional_footer_creds_filter( $creds ) {
if ( is_front_page() ) {
	$creds = 'Front Page Credit';
	return $creds;
	} else {
	$creds = sprintf( 'GLOBAL Credit');
	return $creds;
	}
}

 

Related Posts

  • Conditional Tag is_front_page() v/s is_home(). What to use?
  • Add Custom Body Class in Genesis
  • Customize and edit site footer Credit Text and URL in Genesis
  • Replace site footer widget area conditionally in Genesis
  • Customize Post Meta conditionally in Genesis

Categories: Free Content, Genesis Tutorials Tags: conditional tag, conditional tags, site footer

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service