• 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

Genesis Before Loop Widget isn't Working?

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 › Genesis Before Loop Widget isn't Working?

This topic is: resolved

Tagged: before loop widget

  • This topic has 4 replies, 2 voices, and was last updated 9 years, 9 months ago by MM.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 7, 2013 at 12:45 pm #44596
    MM
    Member

    Hi,

    I've added the Genesis Before Loop Widget. But the content doesn't show up?

    Can anyone help troubleshoot? I'm trying to add 3 images (showing 3 blog categories) above the loop.

    Also, home.php was renamed home.txt to solve an issue. If changing to home.php, screen goes white.

    Any ideas?

    Tks!

    http://mikemetcalfe.co
    June 7, 2013 at 1:01 pm #44607
    Brad Dalton
    Participant

    What code did you use for the widget?


    Tutorials for StudioPress Themes.

    June 7, 2013 at 1:05 pm #44609
    MM
    Member

    Hi Brad

    Your code which successfully registers the Widget in Appearance > Widgets, though nothing displaying before loop when testing.

    Would the home.php issue influence that? Otherwise, open to all ideas?

     

    June 7, 2013 at 1:32 pm #44625
    Brad Dalton
    Participant

    I think its my bad Mike. Sincere apologies.

    Just tested it without any changes and it works for a custom blog page.

    You could try changing the name blog in the conditional tag to the page i.d for your blog.

    You can grab that from the source code or by hovering over the delete or edit button for your blog page.

    Otherwise, if using your home page as your blog page, change the conditional tag to is_home()

    so this line

    if ( is_page('blog') && is_active_sidebar( 'before-loop' ) ) {
    

    to

    if ( is_home() && is_active_sidebar( 'before-loop' ) ) {
    

    or this

    if ( is_front_page() && is_active_sidebar( 'before-loop' ) ) {
    

    If you want the widget to output full width, change the hook from:

    add_action( 'genesis_before_loop', 'wpsites_before_loop_widget', 5 );
    

    to

    add_action( 'genesis_before_content_sidebar_wrap', 'wpsites_before_loop_widget', 5 );
    

    The code is actually written for a custom blog page which is why it didn't work.


    Tutorials for StudioPress Themes.

    June 8, 2013 at 3:48 am #44726
    MM
    Member

    Thanks Brad. Great instructions.  And for any others reading...

    The only tweak I had to make was to delete the below code line

    echo '</div><!-- end .before-loop -->';

    With that line present, the blog loop rolled into the sidebar.

    Without it, the normal home / blog sidebar should remain.

    Cheers!

     

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Genesis Before Loop Widget isn't Working?’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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