• 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

add credit text only on homepage with function.php

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 › add credit text only on homepage with function.php

This topic is: not resolved
  • This topic has 3 replies, 3 voices, and was last updated 9 years, 1 month ago by glenkg.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 21, 2017 at 6:05 am #205114
    glenkg
    Participant

    Hi,

    I was wondering if someone could help me with the following:

    I would like to add a credit text only on the homepage. I know how to add the credit text in general

    add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
    function sp_footer_creds_filter( $creds ) {
    	$creds = '[footer_copyright] &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
    	return $creds;
    }

    I also found this on using it only on home page.. .

    if ( is_home() ) {
        // This is a homepage
    } else {
        // This is not a homepage
    }

    I only have some trouble on combining the two, could someone help me out with this. Would be appreciated 🙂 Thank you

    April 21, 2017 at 6:08 am #205116
    Victor Font
    Moderator
    add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
    function sp_footer_creds_filter( $creds ) {
    
    	return (is_home() || is_front_page()) ? '[footer_copyright] &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>' : "";
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    April 21, 2017 at 6:17 am #205117
    Brad Dalton
    Participant

    You can use a ternary operator

    Or

    You can a conditional tag after your function name like this:

    add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
    function sp_footer_creds_filter( $creds ) {
    
    if ( ! is_front_page() )
        return;
    
    	$creds = '[footer_copyright] · My Custom Link · Built on the Genesis Framework';
    	return $creds;
    }
    

    Tutorials for StudioPress Themes.

    April 21, 2017 at 6:33 am #205120
    glenkg
    Participant

    Hello Victor & Brad,

    Thank you both so very much for responding so quickly. This worked like a charm. Have a great weekend you both and Thanks again 😉

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

© 2026 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