Make every post have a default sidebar?

resolved (8 posts) (4 voices)

  1. christianbk
    Member

    Is there anyway to make every new post have a default sidebar? Looked around and couldn't find anything about it...

    Posted 1 year ago #
  2. Ruderic
    Support

    Hi,

    Let me see if I understand your issue. Do you want to use the same sidebar for every blog post?

    If so, what's wrong with the default behavior of the theme? If you navigate to "Appearance->Widgets" in your admin panel, you can add the widgets to the sidebar called "Primary Widget Area".

    If you want your blog pages to have a different sidebar than the rest of the website, you can create a custom sidebar in the theme options panel and then, when you create your blog page, assign it to your newly created page.

    Posted 1 year ago #
  3. Elliott
    Support

    Hello christianbk,

    As Ruderic says it would be easiest to use the default sidebar and then create custom sidebars for specific pages.

    Or are you wanting to have all of your pages use the default sidebar and all of your posts use another? In that case you can open up /wp-content/themes/awake/sidebar.php and on line 6 you should see this,

    <?php generated_dynamic_sidebar_webtreats(1) ?>

    Go ahead and change it like this,

    <?php if (is_page()) { generated_dynamic_sidebar_webtreats(1); } else { generated_dynamic_sidebar_webtreats(9); } ?>

    That will use the default for pages and the first custom sidebar you created for posts.

    Let us know if this sounds like what your wanting to do.

    Posted 1 year ago #
  4. christianbk
    Member

    Hi guys,

    Thanks for following up so quickly.

    I do want the same sidebar for all of my blog posts... but I'm also using different sidebars for each page of the site.

    I suppose I can, for each blog post, simply go to the dropdown and change the sidebar to the "blogpost" sidebar; I was just wondering if there was a way or an option that allowed you to just say all posts should have 'x' as its sidebar - that's all.

    Thanks

    Posted 1 year ago #
  5. Hi Elliott,

    I'm looking for this too. I've created a custom sidebar called "News". It is the only custom sidebar I have created. I want it to automatically appear on every page in the "News" category. I'm trying your code - see below:

    <?php if (is_page()) { generated_dynamic_sidebar_webtreats(1); } else { generated_dynamic_sidebar_webtreats(9); } ?>

    Using "9" displays nothing.
    If I change it to "8", I see :

    Layouts

    * Right Sidebar
    * Left Sidebar
    * Full Width
    * Column Layouts

    If I change it to "7", I see:

    Shortcodes

    * Style Shortcodes
    * Column Shortcodes
    * Gallery & Image Shortcodes
    * jQuery Tabs & Toggles
    * Widget Shortcodes

    So I'm guessing it is a matter of finding the correct integer.

    Posted 1 year ago #
  6. Eh, nevermind. I changed my code to reference the name of the sidebar and it works perfect.
    <?php if (is_page()) { generated_dynamic_sidebar_webtreats(1); } else { generated_dynamic_sidebar_webtreats('News'); } ?>

    Posted 1 year ago #
  7. Elliott
    Support

    @Christina, glad you got it sorted out okay and thanks for posting your solution.

    @christianbk, In this case you would have your posts use the default sidebar "Primary Widget Area", and then create custom sidebars to use for your pages.

    When editing your page you can select your custom sidebar in the "Custom Sidebar" dropdown below your text editor.

    Let us know if you need more instructions.

    Posted 1 year ago #
  8. christianbk
    Member

    Thanks for your help!

    Posted 1 year ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme