Remove Sub Footer Widgets From Front Page of Outreach Pro

A member of the Genesis community asked this question on the StudioPress community forums :

I just installed outreach pro. I want to remove from just the home page the footer and subfooter widgets. How can I do this?

All you need to do is add a conditional tag after the function on line 89 of the Outreach Pro themes functions.php file like this :

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

if ( is_front_page() )
    return;

<pre><code>if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) ) {
    echo '&lt;div class="sub-footer"&gt;&lt;div class="wrap"&gt;';

       genesis_widget_area( 'sub-footer-left', array(
           'before' =&gt; '&lt;div class="sub-footer-left"&gt;',
           'after'  =&gt; '&lt;/div&gt;',
       ) );

       genesis_widget_area( 'sub-footer-right', array(
           'before' =&gt; '&lt;div class="sub-footer-right"&gt;',
           'after'  =&gt; '&lt;/div&gt;',
       ) );

    echo '&lt;/div&gt;&lt;!-- end .wrap --&gt;&lt;/div&gt;&lt;!-- end .sub-footer --&gt;';  
}
</code></pre>

}

How It Works

The following conditional tag, which has been added to the above code, ends the execution of the outreach_sub_footer function when the front page is loaded so the widgets don’t load on the front page.

if ( is_front_page() )
    return;

return; If called from within a function, the return statement immediately ends execution of the current function.

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.