Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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 4 years ago by  rudtek.
    #817450

    Hey 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,
    Victoria

    #817455

    Hi 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>
    #817867

    Hi rudtek,

    Which page should I go to to see that sidebar?

    Best regards,
    Victoria

    #817948

    it private page

    Isn’t there a suggested way to add sidebars to templates in your theme?

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

    #818005

    Hi Beth! Stay with me. Don’t leave! :)

    #818721

    Hi,

    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,
    Yigit

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

    #818919

    Thanks 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.

    #818933

    Hi there!

    @rudtek thanks for pitching in! :D

    Beth, do you need further help with anything?

    Best regards,
    Sarah

    #818955

    Thanks Sarah, no further help needed. Rudtek’s solution is enough.

    Beth

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

You must be logged in to reply to this topic.