• 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

Entry Widget on Front Page 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 › Entry Widget on Front Page only

This topic is: not resolved
  • This topic has 5 replies, 3 voices, and was last updated 10 years, 2 months ago by Kabolobari.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 18, 2014 at 8:29 pm #101239
    tpowers
    Member

    Hello,
    I've tried a few tags and can't get the widget to show on the first page only... here is my last try and it still shows on the next page of posts. (I've modified this to show right after the header.)

    //* Hook before post widget after the header content
    add_action( 'genesis_after_header', 'expose_after_header', 5 );
    function expose_after_header() {

    if ( is_home() )
    genesis_widget_area( 'after-header', array(
    'before' => '<div class="after-header widget-area">',
    'after' => '</div>',
    ) );

    }
    Thank you! Theresa

    April 19, 2014 at 9:30 am #101283
    nutsandbolts
    Member

    Try changing your condition to this:

    if (is_home() && !is_paged())


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    September 15, 2015 at 4:30 pm #165635
    Kabolobari
    Member

    Hi, Nuts and Bolts, could you kindly correct where this code is bugged? I'm trying to hook a widget area after the header on the blog archive page. I've used:

    //* Register Blog Page After Header Widget Area
    genesis_register_sidebar( array(
    'id' => 'bp-after-header',
    'name' => __( 'Blog Page After Header', 'wintersong' ),
    'description' => __( 'Place stuff here to show before post on blog page', 'wintersong' ),
    ) );

    //* Hook Blog Page After Header Widget Area
    add_action( 'genesis_after_header', 'add_bp_after_header' );
    function add_bp_after_header() {
    if ( is_blog() )
    genesis_widget_area( 'bp-after-header', array(
    'before' => '<div class="bp-after-header widget-area">',
    'after' => '</div>',
    ) );
    }

    And I see the widget area on the backend quite alright but then there's error on the front end. Meaning it's not hooking and I'm bugged. Could you correct the code? I'm pretty awful with php. Thanks.


    KB

    September 15, 2015 at 4:38 pm #165636
    nutsandbolts
    Member

    What error are you seeing on the front end? I'm guessing your conditional might be the problem - try replacing is_blog() with is_home() since is_home() is used for whatever page is designated as the main post archive.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    September 16, 2015 at 1:59 am #165700
    Kabolobari
    Member

    Thank you, Nuts and Bolts. But if ( is_home( '' ) )? I wonder if that isn't counterintuitive since it's the blog archive page I'm talking about here. How about if ( is_page( '79' ) )? I'll try the latter and see. But aside from this line are other lines okay? Thanks.


    KB

    September 16, 2015 at 2:52 am #165717
    Kabolobari
    Member

    Thanks very much, Nuts and Bolts if ( is_home( '79' ) ) worked. Take a look at Kabolobari's Blog but I'm having a bit of formatting (CSS) issues, trying to align everything center, even as I have on this category page.

    Thanks very much!


    KB

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