Hook issue in Education Theme

Community Forums Forums Design Tips and Tricks Hook issue in Education Theme

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Zach Russell 1 year, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16258

    Zach Russell
    Participant
    Post count: 42

    Hello,

    I’m trying to have the footer of a client’s site link to my site, but only on the home page, on all other pages, my site will be listed in plain text. I tried both is_home() and is_front_page() neither function works. The site is expertplumber.wpengine.com

    Here is what the snippet would look like:

    if ( is_home() ) {
    remove_action( 'genesis_footer', 'genesis_do_footer' );
    add_action( 'genesis_footer', 'custom_footer' );
    function custom_footer() {
    ?>
    © Copyright 2012 Expert Plumbing Michigan · All Rights Reserved · WordPress Development and Online Marketing by by ProTech Internet Group

    © Copyright 2012 Expert Plumbing Michigan · All Rights Reserved · WordPress Development and Online Marketing by by ProTech Internet Group
    <?php
    }
    }

    When I do this, it shows with out the link. I’ve tried changing is_home with is_front_page with no luck, along with putting the conditional statement within different parts of the snippet.

    Thanks for your help
    Zach Russell


    ———-
    Zach Russell
    President, ProTech Internet Group

    • This topic was modified 1 year, 7 months ago by  Zach Russell.
    • This topic was modified 1 year, 7 months ago by  Zach Russell.
    • This topic was modified 1 year, 7 months ago by  Zach Russell.
    • This topic was modified 1 year, 7 months ago by  Zach Russell.
    #16266

    Zach Russell
    Participant
    Post count: 42

    Sorry guys, the form is broken, I cannot display the code correctly.


    ———-
    Zach Russell
    President, ProTech Internet Group

    #16337

    braddalton
    Participant
    Post count: 9807

    Place this code with your HTML using the Genesis Simple Hooks plugin field for genesis_after_footer Hook.

    Align the HTML in your editor before pasting the code.
    [php]
    <?php if (is_home() ) { ?>
    <p>Code-Goes-Here</p>
    <?php } ?>
    [/php]

    Note: You can only use conditional query tags after the posts_selection action hook in WordPress (the wp action hook is the first one through which you can use these conditionals). For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php, i.e. outside of a function.


    #16340

    Zach Russell
    Participant
    Post count: 42

    Thanks Brad, makes complete sense. I am a big fan of your WP Sites site, great content! I’m actually starting to post regularly on WP Daily doing WP and SEO articles, I’m excited.

     

    thanks


    ———-
    Zach Russell
    President, ProTech Internet Group

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.