Sidebar missing on custom archive page

Community Forums Forums Design Tips and Tricks Sidebar missing on custom archive page

This topic is: resolved

This topic contains 10 replies, has 2 voices, and was last updated by  csbeck 1 year, 7 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #11219

    csbeck
    Participant
    Post count: 135

    I’ve designed a custom site based on Agency though it’s drastically different from Agency. I’ve created some custom Archive pages to show particular category posts and custom fields. Since updating Genesis (just this week) my sidebar is missing from these pages. Can someone take a look at my code to see if I’m doing something incorrectly?

    Staging site: http://www.rdldev.beckerstudio.com

    One of the pages in question: http://www.rdldev.beckerstudio.com/test-catalog/new-tests
    Code for one of the Archive pages

    • This topic was modified 1 year, 7 months ago by  csbeck.
    • This topic was modified 1 year, 7 months ago by  csbeck.
    #11225

    csbeck
    Participant
    Post count: 135

    Here’s the code for one of the Archive pages ( I had some challenges with putting the link in my original submission above):
    https://gist.github.com/4511552

    As a further note, the sidebar is supposed to show a custom menu. I created the menu just fine and put it in a sidebar widget and it’s showing on the parent page: http://rdldev.beckerstudio.com/test-catalog
    So I know the menu and sidebar actually work. It’s just they aren’t showing up in my custom archive pages – although they did before I upgraded Genesis. Looking at the page source though for those archive pages in the browser, there is a div or section for the sidebar – it shows an empty div. It’s strange. I’m betting though that I’m doing something wrong.

    Again, thanks for your time.

    #11234

    David Decker
    Moderator
    Post count: 93

    In the Gist code snippet I can see no reference of a sidebar for displaying. There’s currently no “get_sidebar( ‘id-of-sidebar’ );” function or for just a widget area, no “dynamic_sidebar( ‘id-of-sidebar’ );” function.

    You need to add on or the other to your template to get an registered sidebar or widget area displayed.


    #11245

    csbeck
    Participant
    Post count: 135

    Thanks so much David. Thanks to you I’m getting close. So I’ve added the sidebar in and it’s showing now. But I can’t see where to put it correctly. I’ve tried several places and it doesn’t seem to end up in the <div id=”sidebar”> instead it goes into a separate div below it. So styling is off, which I could deal with, but there is still a <div id=”sidebar”> above my new div and there’s still an empty text widget inside that. I’d ultimately like to replace the empty text widget with my sidebar so that styling works as it does on the Test Catalog page. Thoughts?

    #11260

    David Decker
    Moderator
    Post count: 93

    Great :)

    I understand what you mean! Please try to add this line of code before the first code line where it says “get_header”:
    remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );

    Does that work?


    #11270

    csbeck
    Participant
    Post count: 135

    Thanks David.

    Unfortunately, it didn’t remove the empty widget or put mine in that location.

    Updated code: https://gist.github.com/4511552

     

    #11276

    David Decker
    Moderator
    Post count: 93

    Ah, I’ve got it to work now and finally tested it before posting here… :)

    Forked to this: https://gist.github.com/4512672

    —> removed dynamic_sidebar… at the bottom — changed/added stuff on top of file. For me this worked, I hope for you too :)


    #11280

    csbeck
    Participant
    Post count: 135

    Wow! Absolutely amazing. You are a magician. Thanks so much for helping.

    BTW – the empty text widget is still in there. Weird. At least it’s under mine so it doesn’t mess it up.

    Can you explain why this worked before the latest Genesis update?

    #11286

    David Decker
    Moderator
    Post count: 93

    Mmh, really don’t know why it worked before v1.9.x — the code we both used now should also work before v1.9. I have to do some deeper look into code changes between 1.8.x and 1.9.x before I might understand why…

    For the text widget on your test site: I see it but it is definitely wrapped into THAT sidebar, so it must be an active widget in this sidebar otherwise I cannot explain it. On my test site I don’t have it there.

    Are you sure it isn’t setup in this widget area?

    So maybe this could also be some strange WP behavior where widget settings get mixed up internally… especially when changing themes or plugins (which register sidebars/widgets).

    You could test with another sidebar id in the above code if it’s still there.


    #11288

    David Decker
    Moderator
    Post count: 93

    I just did a code comparison between 1.8.2 and 1.9.x and could not find any change that would have lead to your issue with the custom sidebar. To be honest, there aren’t any changes at all regarding the sidebars between those versions :)

    I assume there must be any other modification maybe that was blocking it. Anyways if it’s working now, that’s what matters :) And from my point of view we’ve found Genesis/WP compliant way of doing it so it should be future-proof.


    #11313

    csbeck
    Participant
    Post count: 135

    Thanks so much for helping with the solution and looking into the issue. You have been very helpful. I’ll look into switching things around to see if something shows why this worked earlier, but like you said, I’m mostly happy that it works without breaking.

    You rock!

    Chris

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

You must be logged in to reply to this topic.