Support » Theme: Customizr » No sidebar.php file

  • charliespider

    (@charliespider)


    the plugin I work on uses some custom templates for it’s custom post types, and those templates utilize get_sidebar(), which throws the following error with your theme:

    Notice: Theme without sidebar.php is deprecated since version 3.0 with no alternative available. Please include a sidebar.php template in your theme. in \wp-includes\functions.php on line 2968

    thought you might like to know.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Nicolas GUILLAUME

    (@nikeo)

    Hi Brent, thanks for letting me know this.
    What is the plugin name please?

    charliespider

    (@charliespider)

    Thanks for getting back to me.
    I’m the lead developer for Event Espresso (www.eventespresso.com) and was just trying out a bunch of themes with an upcoming version of our core plugin that isn’t publicly available yet.

    there’s a hook in get_sidebar() (/wp-includes/general-template.php line 85)

    do_action( 'get_sidebar', $name );

    that would have allowed an easy fix if only your sidebar file had been named:

    sidebar-class-content.php instead of class-content-sidebar.php

    So i don’t know off the top of my head what another easy solution would be.

    This doesn’t really affect what I’m doing at all, I’m just trying to help you out. I like this theme btw.

    Theme Author Nicolas GUILLAUME

    (@nikeo)

    Ok. Thanks for the feedback

    Hi guys,
    did we figure out a solution yet?

    I’m still trying to create a custom sidebar file for my CPT (‘projects’), something like sidebar-projects.php, but I can’t get it to work anywhere.

    I also tried to put a standard sidebar.php in ../inc/parts but no luck.

    Any suggestion Nikeo on how to solve this?

    Hi Giorgio, you might want to have a look to the Widget Logic plugin :
    https://wordpress.org/plugins/widget-logic/
    It handles the WP conditional tags (including CPT conditions) very well, right below any widgets in the WP admin > widgets.
    Like for example is_single() && (get_post_type()=='projects')

    There’s also the php coding way. More advanced technique but still possible with hooks API of the theme.

    Hope this will help!

    Thanks Nikeo,
    but what I really want to achieve is having a custom sidebar file.php related to my CPT.

    I have created a file called sidebar-projects.php but it does not kick in properly.
    I have also created a single-projects.php file and in this one I’m not sure how to hook my sidebar-projects.php

    I know it is confusing, but I need to have a series of custom loops in my custom sidebar that are only displaying on my CPT pages.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘No sidebar.php file’ is closed to new replies.