• 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

conditional footer credits

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 › conditional footer credits

This topic is: not resolved

Tagged: conditional, credit, footer, is_home

  • This topic has 5 replies, 3 voices, and was last updated 10 years ago by firebrick.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • March 23, 2015 at 9:33 am #145335
    souleye
    Member

    hi, I'm trying to put a designer credit on the footer but I want it to appear just on the homepage. when I insert this code:
    if ( is_home() ) {
        // This is the blog posts index
        echo ' · example web design example';
    }
    I get a bunch of errors. any assistance will be appreciated. thanks
    souleye

    http://www.xhibitswebdesign.com/zohery/
    March 23, 2015 at 6:21 pm #145385
    Ren Ventura
    Member

    If that code is exactly how you're using it, you have to attach it to an action hook. Since you want it in the footer, you'd use something like this:

    remove_action( 'genesis_footer', 'genesis_do_footer');
    add_action( 'genesis_footer', 'my_custom_footer' );
    function my_custom_footer() {
    
    	// code here
    
    }
    

    This removes the default Genesis footer and outputs your own.


    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

    March 30, 2015 at 2:45 pm #146192
    souleye
    Member

    thank you ren. I tried it but it was giving me fatal error. I guess, because it resulted in a 500 internal error. I don't have to use that code 'exactly'. I have known it to work on a regular theme. I see that genesis themes are coded differently and I'm learning to get used to them.

    May 22, 2015 at 12:55 am #153215
    firebrick
    Member

    Could I please jump into this post as I have the same question.

    I would appreciate a little more information on how to do this.

    @Ren where you have indicated
    // code here

    I want to insert something like this but the syntax isn't right. Can you please help me out - what should it be?

    if (is_front_page())
    echo 'My Custom Link'

    if (!is_front_page())
    echo 'My Custom Message'

    thanks

    firebrick

    May 22, 2015 at 5:42 pm #153337
    Ren Ventura
    Member

    @firebrick To explain what you need to do with your code, you have to start with adding a semi-colon at the end of each echo statement because, as you have it, you'll get fatal syntax errors. Next, the if ( ! is_front_page() ) should be replaced with else. Lastly, indent your echo statements since they're not using curly braces (or just use curly braces). This would give you something like:

    
    if ( is_front_page() ) {
    
    	echo '<a href="#">My Custom Link</a>';
    
    } else {
    
    	echo 'My Custom Message';
    
    }
    

    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

    May 24, 2015 at 7:53 pm #153515
    firebrick
    Member

    @Ren Thank you for your assistance and explanation.

    Exactly what I needed.

    cheers

    firebrick

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