Tagged: archive, custom widget area
-
AuthorPosts
-
July 6, 2017 at 12:54 am #816958
I’ve got an archive page setup. I’m trying to create a widget area that will only appear on this archive. So I have a file called archive-rules_files.php.
I created a new widget area in my Custom Widget Area section called “rules & filings” and added a text widget to it. But i can’t get it to load onto the page.
I tried this:
//get the sidebar //$avia_config['currently_viewing'] = 'blog'; //get_sidebar('Rules & Filings'); dynamic_sidebar('Rules & Filings');
and it actually loaded my sidebar, but it loaded at 100% width under my content. and left the sidebar area blank.
Thanks for your help
- This topic was modified 7 years, 4 months ago by rudtek.
July 6, 2017 at 7:10 pm #817450Hey rudtek,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJuly 6, 2017 at 7:25 pm #817455Hi Victoria,
Thanks for your help access is below:
as a note: for a temporary fix I wrapped the above code in the aside and div manually:
<aside class="sidebar sidebar_left alpha units" role="complementary" itemscope="itemscope" itemtype="https://schema.org/WPSideBar"><div class="inner_sidebar extralight-border"> <?php //get the sidebar //$avia_config['currently_viewing'] = 'blog'; //get_sidebar('Rules & Filings'); dynamic_sidebar('Rules & Filings'); ?> </div></aside>
July 7, 2017 at 3:05 pm #817867Hi rudtek,
Which page should I go to to see that sidebar?
Best regards,
VictoriaJuly 7, 2017 at 6:00 pm #817948it private page
Isn’t there a suggested way to add sidebars to templates in your theme?
July 7, 2017 at 8:40 pm #818004I have the same question. I used the custom widget feature in the widgets area. Then on my cpt custom single page I tried adding the name of the sidebar to my template like this: get_sidebar(‘alumni-area’); but using all combos of the name of the widget with space between words, dash between, case sensitive, all lowercase. So that may not be the way it’s done.
Should I open a new ticket? Or stay with this, as it’s the same question.
July 7, 2017 at 8:44 pm #818005Hi Beth! Stay with me. Don’t leave! :)
July 10, 2017 at 1:44 pm #818721Hi,
Have you figured it out already? :)
If not, please try using this plugin – https://wordpress.org/plugins/widget-logic/ and see – https://codex.wordpress.org/Function_Reference/is_singular :)Best regards,
YigitJuly 10, 2017 at 6:04 pm #818904I prefer not to add plugins to fix a problem. I’ll just go with the way i mentioned above. It seems strange that your function to call the sidebar doesn’t allow for a page parameter. @bethbacken. Try what I suggested above.
July 10, 2017 at 6:26 pm #818919Thanks Rudtek,
That works for me. Thanks for solving this!
I agree it’s preferable not to use a plugin just to call a sidebar in a template, this is a much better solution.July 10, 2017 at 6:54 pm #818933Hi there!
@rudtek thanks for pitching in! :DBeth, do you need further help with anything?
Best regards,
SarahJuly 10, 2017 at 7:38 pm #818955Thanks Sarah, no further help needed. Rudtek’s solution is enough.
Beth
-
AuthorPosts
- You must be logged in to reply to this topic.