Focus-widget to appear on homepage only

Community Forums Forums Design Tips and Tricks Focus-widget to appear on homepage only

This topic is: not resolved

This topic contains 8 replies, has 3 voices, and was last updated by  professorz 2 years, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #32255


    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!





    Use widget logic:

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

    Nick Ciske | | @nciske
    Did I help you? Say thanks:



    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?



    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



    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.



    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



    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:

    Thanks so much for your help!






    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.



    @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 =)



Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.