Community Forums › Forums › Archived Forums › Design Tips and Tricks › Trying to remove footer from one or two pages only
Tagged: conditional tags, css, footer, genesis_do_footer, genesis_footer
- This topic has 10 replies, 5 voices, and was last updated 11 years, 11 months ago by And_or.
-
AuthorPosts
-
January 4, 2013 at 3:13 pm #9570mediacafeonlineMember
I'm using the current version (Jan. 2013) of Genesis and the Executive theme. I'm looking to remove the footer widget area from a few pages only - on the site.
The support folks were kind enough to pass this along:
To get you started, you can use code from here to remove the footer: http://my.studiopress.com/snippets/footer/#custom-footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
In combination with some conditional tags: http://codex.wordpress.org/Conditional_TagsI'm getting a little bogged down here ... any ideas
January 4, 2013 at 3:28 pm #9576buddy_boy8403ParticipantWhat pages do you want the footer removed on? Nick The Geek has a great tutorial on conditional tags here. The conditional you are going to want to add to your footer logic in your functions.php file is:
if
(!is_page()) { ?>
And then specify the page within the logic.
January 4, 2013 at 3:47 pm #9585Brian BournMemberIf you are trying to remove the footer widgets (not the footer) on only a few pages, another option would be to create a new page template and upload it to your theme folder to make it selectable from the page editor without having to track down the page IDs or edit your functions file every time.
Bourn Creative | bourncreative.com | Twitter
January 4, 2013 at 4:10 pm #9590mediacafeonlineMemberWOW, @BrianBourn, that is so elegant ... and late on a Friday, too!!!
What would I have to add to make this functional?
I added to Genesis folder, selected the "no footer" template - what loads is a completely blank page.
January 4, 2013 at 5:52 pm #9605And_orParticipantIf its just for a few pages, why not simply hide the widgets with something like this in your css file:
<div class="cssRule cssEditableRule insertInto editGroup " role="presentation"> <div class="cssHead focusRow " role="listitem">.postid-177 #footer-widgeted , .postid-178 #footer-widgeted{</div> <div class=" " role="group"> <div class="cssPropertyListBox " role="listbox"> <div class="cssProp focusRow editGroup " role="option"> display: none;</div> </div> </div> <div class=" editable insertBefore " role="presentation">}</div> <div class=" editable insertBefore " role="presentation">
If you are on the page you want to have the widgets hidden on, you can check the body class to see which id you need to use.
Not elegant, but efficient. But I will copy Briancreatives snippet for future use 🙂
Simplicity is not Simple Webtaurus
January 4, 2013 at 8:06 pm #9659Brian BournMemberThis file should go in your child theme folder "executive". If you click the github link you can download the complete php file to add to your child theme. You shouldn't ever edit or add anything to the "genesis" theme folder.
Bourn Creative | bourncreative.com | Twitter
January 7, 2013 at 2:35 pm #10173mediacafeonlineMemberBrian,
That did the trick.
AWESOME!!!
Brian
January 7, 2013 at 2:40 pm #10175Bill MurrayMember@Brian - What's the advantage of adding a custom body class? Just as a reminder that the footer widgets aren't there by design?
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
January 7, 2013 at 2:47 pm #10179mediacafeonlineMemberI wanted to remove footer only on eCommerce pages both to secure the pages for the SSL, but also to keep the content focus of the page to be the transaction. Some of the footer elements, that change, include video and potentially other items that aren't easily coded to serve up on http and https pages with the same html.
January 7, 2013 at 4:02 pm #10197Brian BournMemberBill-We add a custom body class on every custom template as things may shift around a little bit when removing elements and the template may need some targeted CSS tweaks. WordPress will usually add it's own class that you can use but it is usually much longer than a custom class.
Bourn Creative | bourncreative.com | Twitter
January 7, 2013 at 5:57 pm #10220And_orParticipantI just noticed I sent gibberish into my answer.. below is what it was supposed to look like. ( also to see if it works okay this time)
.postid-177 #footer-widgeted , .postid-178 #footer-widgeted { display: none; }
I miss the preview that you could check before submitting on the old forum
Simplicity is not Simple Webtaurus
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.