Community Forums › Forums › Design Tips and Tricks › Hook issue in Education Theme
This topic contains 3 replies, has 2 voices, and was last updated by zacharyrussell 3 months, 3 weeks ago.
-
AuthorPosts
-
January 29, 2013 at 8:44 pm #16258
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 3 months, 3 weeks ago by
zacharyrussell.
-
This topic was modified 3 months, 3 weeks ago by
zacharyrussell.
-
This topic was modified 3 months, 3 weeks ago by
zacharyrussell.
-
This topic was modified 3 months, 3 weeks ago by
zacharyrussell.
January 29, 2013 at 8:48 pm #16266Sorry guys, the form is broken, I cannot display the code correctly.
———-
Zach Russell
President, ProTech Internet GroupJanuary 30, 2013 at 12:40 am #16337Place 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 if (is_home() ) { ?> <p>Code-Goes-Here</p> <?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.
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.January 30, 2013 at 12:54 am #16340Thanks 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 -
This topic was modified 3 months, 3 weeks ago by
-
AuthorPosts
You must be logged in to reply to this topic.