• 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

Focus-widget to appear on homepage only

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 › Focus-widget to appear on homepage only

This topic is: not resolved

Tagged: focus homepage layout

  • This topic has 8 replies, 3 voices, and was last updated 12 years, 8 months ago by professorz.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • March 31, 2013 at 9:11 am #32255
    professorz
    Member

    Hi all,

    I have added and registered a featured bottom widget that I want to display below the main content area on the homepage of a site built on the focus theme. I only want it to display on the home page and it is displaying on all pages.

    The home.php file for focus is thrwoing me for a loop, pun intended, because it is different than any child theme I have worked in so far. It doesn't have the usual code where you specify what you want to display just on the home page - instead it only has language for the Genesis grid loop.

    Does anyone know how I can get a widget area to ONLY display on the home page in the focus theme?

    Thanks very much!

     

     

    March 31, 2013 at 9:20 am #32257
    nciske
    Member

    Use widget logic:
    http://wordpress.org/extend/plugins/widget-logic/

    Or...
    Hide the widget with CSS on all pages except home and show it only on the home page.


    Nick Ciske | https://luminfire.com/ | @nciske
    Did I help you? Say thanks: http://bit.ly/1lahwy0

    March 31, 2013 at 9:35 am #32261
    professorz
    Member

    Thanks so much for the prompt reply and great suggestion!

    I'm going to try this as soon as I get back from Easter dinner.

    Would you mind leaving this request open in case I need any additional assistance with this?

    March 31, 2013 at 10:03 am #32268
    Brad Dalton
    Participant

    Better to add the widget code to your functions.php file than the home.php template.

    What code did you use to add the widget? You can easily add a conditional tag to the code and avoid installing another plugin and editing your template files.

    What hook location are you using for the widget?

    Here's the code that can be easily modified using another hook

    https://gist.github.com/5257550


    Tutorials for StudioPress Themes.

    March 31, 2013 at 2:41 pm #32327
    professorz
    Member

    Hi Brad,

    With Focus, I saw no place to add any code for widgets in the home.php file, so the 2 following bits of code were added to the functions.php file:

    /** Add the featured bottom section */
    add_action( 'genesis_after_post_content', 'custom_featured_bottom_text' );
    function custom_featured_bottom_text() {
    genesis_widget_area( 'featured-bottom', array(
    'before' => '<div class="featured-bottom widget-area">',
    ) );
    }

    - AND -

    /** Register widget areas */
    genesis_register_sidebar( array(
    'id' => 'featured-bottom',
    'name' => __( 'Featured Bottom', 'genesis' ),
    'description' => __( 'This is the featured bottom section of the homepage.', 'focus' ),
    ) );

    The widget is now showing below the main content on every page; trying to just get it to dsiplay on the home page. 

    Are you saying I should add the Hook to my Home Page Only language somewhere in one of the above codes in the functions.php file?

    And, thank you ver much for replying.

    April 1, 2013 at 2:09 am #32397
    Brad Dalton
    Participant

    Can you link to your site please.

    Are you using full width on front page?

    Are you displaying posts on the home page or using a static page for the front page?

    The code will be different for each.

    Which hook location do you want to use?

    More code on Github https://gist.github.com/5283769


    Tutorials for StudioPress Themes.

    April 1, 2013 at 6:49 am #32413
    professorz
    Member

    G'Day Brad,

    Theme is set to sidebar/content for the home page and entire site.

    Using a static page for the home page.

    Currently telling featured bottom widget to display genesis_after_post_content - which it is - except on all pages.

    It appears I may want to be using after_content_home instead?

    Definitely only want this widget on the home page below the static page content and only content width, not after content sidebar wrap.

    Present URL is:

    http://virtualassistantwebdesign.com/betaL1/

    Thanks so much for your help!

     

     

     

    April 1, 2013 at 8:33 am #32427
    Brad Dalton
    Participant

    The code i embedded above works on the home page.

    There is no after_content_home hook

    Please use that code and change the hook if needed.


    Tutorials for StudioPress Themes.

    April 1, 2013 at 11:01 am #32468
    professorz
    Member

    @nciske and @braddalton

    Thank you both very much for your time and suggestions.

    A combination of both resolved my issue and the widget is now only appearing on the home page =)

     

     

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