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
July 6, 2017 at 7:10 pm #817450
- This topic was modified 4 years ago by 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?
VictoriaJuly 6, 2017 at 7:25 pm #817455
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 #817867
Which page should I go to to see that sidebar?
VictoriaJuly 7, 2017 at 6:00 pm #817948
it private page
Isn’t there a suggested way to add sidebars to templates in your theme?July 7, 2017 at 8:40 pm #818004
I 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 #818005July 10, 2017 at 1:44 pm #818721
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 :)
YigitJuly 10, 2017 at 6:04 pm #818904
I 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 #818919
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 #818933
@rudtek thanks for pitching in! :D
Beth, do you need further help with anything?
SarahJuly 10, 2017 at 7:38 pm #818955
You must be logged in to reply to this topic.