Forums

How to prevent sidebar widgets on Pages? (3 posts)

  1. helices
    Member
    Posted 5 months ago #

    I've inherited a custom WordPress theme (http://prismmpls.org) that uses the (left) sidebar for custom hierarchical menus.

    I'm told that they planned a blog; but, they never implemented it. I have setup the blog and it works great! I want to use widgets in conjunction with ONLY the blog and blog posts.

    I've hacked some PHP so that - in most cases - when their sidebar menus show, NO widgets show.

    However, when a Page has NO sidebar menu, widgets show - I don't want this.

    Also, on the blog Page, there is NO sidebar menu and the widgets show, but far down the Page. What's up with this?

    In their sidebar.php, I added "!$children && " to their code:

    <?php if ( !$children && !dynamic_sidebar( 'sidebar-widget-area' ) ) : ?>

    Such as it is, that is what's working now.

    What PHP code will prevent widgets in the sidebar for Pages?

    How could I get sidebar widgets to show properly ONLY for the blog Page?

    Where ought that code to go?

    Please, advise.

    Thank you.

    Best Regards,

    helices

  2. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    The most obvious answer would to create a non-widget-ready sidebar that is called in the default page.php template file.

  3. helices
    Member
    Posted 5 months ago #

    Hi, esmi!

    OK - thank you

    How would I do that?

    Best Regards,

    helices

Reply

You must log in to post.

About this Topic