Genesis Before Loop Widget isn't Working?

Community Forums Forums Design Tips and Tricks Genesis Before Loop Widget isn't Working?

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  MM 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44596

    MM
    Participant
    Post count: 128

    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
    #44607

    braddalton
    Participant
    Post count: 10261

    What code did you use for the widget?


    #44609

    MM
    Participant
    Post count: 128

    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?

     

    #44625

    braddalton
    Participant
    Post count: 10261

    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
    [php]
    if ( is_page(‘blog’) && is_active_sidebar( ‘before-loop’ ) ) {
    [/php]
    to
    [php]
    if ( is_home() && is_active_sidebar( ‘before-loop’ ) ) {
    [/php]
    or this
    [php]
    if ( is_front_page() && is_active_sidebar( ‘before-loop’ ) ) {
    [/php]

    If you want the widget to output full width, change the hook from:
    [php]
    add_action( ‘genesis_before_loop’, ‘wpsites_before_loop_widget’, 5 );
    [/php]
    to
    [php]
    add_action( ‘genesis_before_content_sidebar_wrap’, ‘wpsites_before_loop_widget’, 5 );
    [/php]

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


    #44726

    MM
    Participant
    Post count: 128

    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!

     

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

The topic ‘Genesis Before Loop Widget isn't Working?’ is closed to new replies.