The Outreach Pro child theme from StudioPress includes 2 sub footer widgets of different widths which display on all pages of your site.
Robert asked me this question in the comments on this post about removing footer widgets on specific pages:
Is this also possible with sub footers? I would like to display the sub footers (Outreach Pro theme) only on the homepage. I’ve been trying this with code snippets but I can’t figure it out.
There’s 2 ways you can control which pages these widgets display on:
- You can move the code from your functions.php file into your front-page.php file
- Or you can add a conditional tag after the function in your functions.php file.
Move Code To front-page.php
The 1st solution limits the display of your sub footer widgets to the front page of your site only.
Simply copy this code from your functions.php file and paste it at the end of the front-page.php file before the closing genesis(); tag.
You will need to remove the code from your functions file after copying the code.
Add Conditional Tag to functions.php code
The 2nd option which is far more flexible requires the addition of a conditional tag after the function.
Here’s how the code can look after adding the conditional tag.
In the above example, i have added the is_front_page() conditional tag so the widgets only display on the front page of your site. You can change this tag to any other conditional tag.