• Hi there,
    I’ve got custom archive and single pages for a custom post type I’ve created.
    The only problem is, the get_footer() function is adding the whole sidebar at the bottom of the page.
    I’ve even called my own footer, via get_footer (‘nosidebar’), but it’s still making a sidebar.
    I’ve deleted any code about get_sidbar() in my custom footer php.
    Any suggestions?
    Thanks so much.

Viewing 11 replies - 1 through 11 (of 11 total)
  • this was happening to me earlier but only when some margin is not proportional with content and stretches it more than what it should.

    Try changing css with inspect element or firebug, this is the best way to explore css.

    what theme are you using? (download link?)

    can you provide a link to illustrate the problem?

    are you sure the sidebar is called from within footer.php?

    Thread Starter bennyk

    (@bennyk)

    I’m using twentyeleven theme.
    I’m not sure I understand the anatomy of wordpress quite well enough to know where the sidebar is being called from.
    The page is displayed using a custom template file called single-candidates.php. And the only way i can stop the sidebar is by commenting out get_footer() at the bottom of this file, But then the page isn’t properly finished, doesn’t hvae the WordPress credit, etc.

    Where else could the sidebar be called from?
    Thanks

    This is the page

    Thread Starter bennyk

    (@bennyk)

    Sorry, forgot the page is still set to private. Suffice to say my template occupies the full width of the layout, and the sidebar is appearing underneath my custom content.

    Thread Starter bennyk

    (@bennyk)

    Boban thanks for your reply, but I need to call the sidebar from within my own template, and NOT have it called automatically outside my template, if that makes sense.

    in Twenty Eleven, the sidebar is called from with the templates;

    however, the ‘theme extension’ plugin could interfere (? I have no personal experience with that plugin).

    Thread Starter bennyk

    (@bennyk)

    You’re right, the Theme Extension Plugin is doing it… I’ll guess I’ll hit their support site to find out how to supress it. (Just clicking it off for all pages won’t do, I need to just turn it off for my custom post types).
    Any suggestions welcome.

    Thread Starter bennyk

    (@bennyk)

    The support forum on the plug-in site doesn’t work.
    So, from my noob understanding, there’s probably a way I can remove filters that activate the plugin that are hooked into the get_footer function… conceivably I could add code to functions.php for this?
    Any tips on what to look for and code in both the plug-in code and functions.php would be awesome.
    Thank you

    for some coding on how to have sidebars in single posts and/or static pages (without a plugin), see my old post http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages

    might need to be adapted to accommodate the custom post types.

    Thread Starter bennyk

    (@bennyk)

    Thanks for the tip… I ended up putting a condition in the code for the plugin that returned false if the post type was my custom post type.

    Now I need to add a custom sidebar, and not sure if your above solution is exactly what I need…

    I registered a sidebar in functions.php. It appears on the widgets page and I can add widgets to the sidebar. I can call the sidebar via get_sidebar(‘custom’), and it does indeed load sidebar-custom.php… BUT… it’s not displaying any of the content that is added in the widgets…

    What do i need to do to make sure that widget content is displayed?

    Thanks!

    Thread Starter bennyk

    (@bennyk)

    after reading the codex I realized I need to use dynamic_sidebar() in my custom sidebar file, like so:

    <?php
    if ( function_exists ( dynamic_sidebar('sidebar-custom') ) ) :
      dynamic_sidebar ('sidebar-custom');
     endif;
    ?>

    This code goes in my sidebar-custom.php file and is called in my template via get_sidebar(‘custom’);

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Can't stop sidebar’ is closed to new replies.