Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing Footer
Tagged: footer, functions.php, hook, html
- This topic has 17 replies, 3 voices, and was last updated 12 years, 1 month ago by
Jen Baumann.
-
AuthorPosts
-
January 6, 2013 at 10:11 pm #10042
deconq
MemberI am trying to completely replace my footer with a custom one. This line of code, recommended in the code snippets page:
remove_action( 'genesis_footer', 'genesis_do_footer' );
I put that line of code into my functions.php file, but it doesn't remove the footer like it should be doing. I can add in a new custom footer with add_action, but it just puts it on top of the existing footer without removing it.
Any ideas for why the code isn't working? Everything else in my functions.php file works fine.
January 6, 2013 at 10:18 pm #10046Jen Baumann
ParticipantWhat theme are you using?
January 6, 2013 at 10:27 pm #10051deconq
MemberMy own custom child theme based on the basic framework.
January 6, 2013 at 10:55 pm #10060Jen Baumann
ParticipantIf you haven't added any other functions to move it, then that should work. Any plugins that may be altering things?
January 6, 2013 at 11:12 pm #10066deconq
MemberI deactivated all my plugins and the default footer's still there. I also tried creating a new blank child theme with that function call, looked at the live preview, footer was still there.
January 7, 2013 at 12:56 am #10071Brad Dalton
ParticipantInstall the Genesis Simple Hooks Plugin http://wordpress.org/extend/plugins/genesis-simple-hooks/
and find:
genesis_footer Hook
This hook, by default, outputs the content of the footer (inside the #footer div).
Unhook genesis_do_footer() function from this hook? (Unhook this function to remove your footer)
January 7, 2013 at 1:39 am #10075deconq
MemberI'm an advanced user, I don't need a bloated plugin. A plugin is just code after all, so surely I'd be able to achieve the same effect by writing the code myself in functions.php. Only I can't...
January 7, 2013 at 2:35 am #10078Brad Dalton
ParticipantJanuary 7, 2013 at 4:29 am #10081deconq
MemberSorry to be rude Brad but judging by that 'solution' it looks like you haven't even read my original post.
Jen, do you have any ideas?
January 7, 2013 at 5:01 am #10082Brad Dalton
ParticipantIf you installed the Simple Hooks plugin you can remove the footer and then use the code to customize your own.
I tested this and it works.
The code comes from StudioPress and so does the plugin.
January 7, 2013 at 5:23 am #10084deconq
MemberOK I tested the plugin and it worked, but I'd still rather not have to install a bloated multi-purpose plugin where I should be able to accomplish the same thing with a single line of code in functions.php.
If the plugin works for me, then why doesn't the function call work for me? I guess my question now is - what code is the plugin using to remove the footer?
January 7, 2013 at 10:19 am #10131Jen Baumann
ParticipantWhat's your url?
January 7, 2013 at 6:19 pm #10226deconq
MemberThis reply has been marked as private.January 7, 2013 at 6:23 pm #10228deconq
MemberI was wondering, perhaps the reason the plugin works but functions.php doesn't is because my child theme code gets run before the Genesis code is, so effectively I remove the footer before it's even added and then Genesis adds it back in. Whereas in a plugin the plugin code gets run after the theme code? Does that sound right?
But then that raises the question, why does the functions.php code seem to work for other users but not me?
January 7, 2013 at 6:36 pm #10232Jen Baumann
ParticipantGenesis code needs to run before the child theme can. Unless you are putting the footer code before the init line. It should just go toward the bottom.
When you tested on the live site, did you disable total cache? Your footer is in the right location for this to work, that's why I wanted a url 🙂
January 9, 2013 at 9:44 pm #10863deconq
MemberWait, what's the init line? I don't have that in my functions file.
January 10, 2013 at 3:22 am #10892deconq
MemberI solved it, turns out the reason was because I didn't have an init line in my functions.php. I downloaded the Genesis sample child theme and copied the code from there into my file and the footer disappeared.
January 10, 2013 at 7:29 am #10932Jen Baumann
ParticipantI'm glad you resolved it!
-
AuthorPosts
- The topic ‘Removing Footer’ is closed to new replies.