• 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

hide sub footer left and right widgets on a few pages?

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 › hide sub footer left and right widgets on a few pages?

This topic is: not resolved

Tagged: Outreach Pro, sub-footer

  • This topic has 18 replies, 5 voices, and was last updated 9 years ago by Tony-BV.
Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • January 12, 2014 at 2:02 pm #84805
    lindebjerg
    Member

    I would like to hide sub footer left and right widgets on some pages.
    Page IDs where to hide the widgets: 822, 43, 1044

    http://granum.weborbis.de/
    January 12, 2014 at 3:13 pm #84825
    Brad Dalton
    Participant

    Add a conditional tag after the function in the PHP code.

    https://gist.github.com/braddalton/c589bc2b43ffc2184421


    Tutorials for StudioPress Themes.

    January 13, 2014 at 4:15 am #84933
    lindebjerg
    Member

    I have tried to inset your code into the function.php, but it did not change anything?

    January 13, 2014 at 4:25 pm #85062
    Brad Dalton
    Participant

    Hello @lindebjerg

    Just tested the code locally on the Outreach Pro theme. Please try again.

    Copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.


    Tutorials for StudioPress Themes.

    January 14, 2014 at 3:21 am #85116
    lindebjerg
    Member

    if I do so, the site turns all blank ;(

    January 15, 2014 at 8:43 pm #85440
    Brad Dalton
    Participant

    I tested the code which works perfectly.

    Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++


    Tutorials for StudioPress Themes.

    June 28, 2016 at 8:37 am #188444
    Tony-BV
    Participant

    Hi Braddalton, I was looking to do the same thing. I tried using this code with my page and my site crashed. I got an erron message so I had to use the backup function.php. Here is the code I used. Any advice for me? Thanks

    //* Add the sub footer section
    add_action( 'genesis_before_footer', 'outreach_sub_footer', 5 );

    function outreach_sub_footer() {

    if ( !is_page( array ( 139 ) ) ) {
    if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) ) {
    echo '<div class="sub-footer"><div class="wrap">';

    genesis_widget_area( 'sub-footer-left', array(
    'before' => '<div class="sub-footer-left">',
    'after' => '</div>',
    ) );

    genesis_widget_area( 'sub-footer-right', array(
    'before' => '<div class="sub-footer-right">',
    'after' => '</div>',
    ) );

    echo '</div><!-- end .wrap --></div><!-- end .sub-footer -->';
    }
    }
    }

    June 29, 2016 at 1:38 am #188501
    Brad Dalton
    Participant

    Try this

    //* Add the sub footer section
    add_action( 'genesis_before_footer', 'outreach_sub_footer', 5 );
    function outreach_sub_footer() {
    if ( is_page( 139 ) ) 
    return;
    if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) ) {
    echo '<div class="sub-footer"><div class="wrap">';
    
    genesis_widget_area( 'sub-footer-left', array(
    'before' => '<div class="sub-footer-left">',
    'after' => '</div>',
    ) );
    
    genesis_widget_area( 'sub-footer-right', array(
    'before' => '<div class="sub-footer-right">',
    'after' => '</div>',
    ) );
    
    echo '</div><!-- end .wrap --></div><!-- end .sub-footer -->';
        }
    }
    

    Tutorials for StudioPress Themes.

    June 29, 2016 at 7:27 am #188517
    Tony-BV
    Participant

    Thanks for the response, but that did not work either. This is the error message I got: Fatal error: Cannot redeclare outreach_sub_footer() (previously declared in /home/preloade/public_html/wp-content/themes/outreach-pro/functions.php:89) in /home/preloade/public_html/wp-content/themes/outreach-pro/functions.php on line 158

    June 29, 2016 at 7:32 am #188518
    Brad Dalton
    Participant

    Only add the function once otherwise change both instances of the function name

    outreach_sub_footer

    Tutorials for StudioPress Themes.

    June 29, 2016 at 7:47 am #188522
    Tony-BV
    Participant

    Does that mean you want me to remove the other function? I'm a little confused. Can I send you the file? Thanks

    June 29, 2016 at 8:05 am #188523
    Brad Dalton
    Participant

    Paste the code into a Github Gist and link to it from here please.


    Tutorials for StudioPress Themes.

    June 29, 2016 at 8:20 am #188525
    Tony-BV
    Participant
    This reply has been marked as private.
    June 29, 2016 at 9:07 am #188530
    Christoph
    Member

    PSA: If you mark a post/reply as private only you and moderators can see it.


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    June 29, 2016 at 9:29 am #188535
    Tony-BV
    Participant

    OK I did not know that. Here you go https://gist.github.com/Tony-BV/9b9ce6a01e11ea2652b022e038bd3051

    July 2, 2016 at 2:09 pm #188782
    Tony-BV
    Participant

    Hi, I never heard back so I wanted to be sure you got my last reply. Here you go https://gist.github.com/Tony-BV/9b9ce6a01e11ea2652b022e038bd3051

    July 3, 2016 at 10:52 pm #188823
    Genesis Developer
    Member

    Replace this line

    if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) ) {

    WITH

    if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) && ( ! is_page( 139 ) ) ) {


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    July 4, 2016 at 2:34 am #188830
    Brad Dalton
    Participant

    Here's your functions file with the modified code i tested


    Tutorials for StudioPress Themes.

    July 4, 2016 at 8:58 am #188854
    Tony-BV
    Participant

    Thanks Braddalton, that worked. Thank you for taking the time to help. This is one of the reasons why I only use you guys for all my blogs. Happy 4th Of July!

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