Title: Doesn&#8217;t work using get_sidebar() in custom function
Last modified: October 18, 2016

---

# Doesn’t work using get_sidebar() in custom function

 *  Resolved [h-u-g-o](https://wordpress.org/support/users/h-u-g-o/)
 * (@h-u-g-o)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/)
 * Hi there!
 * I’m using `get_sidebar()` in a custom function and all widgets are shown up, 
   the time scheduler doesn’t work in that context. What’s the solution?
 * Kind regards
    Hugo

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8325347)
 * Normally that should work. `get_sidebar()` is function called in nearly every
   theme, without any errors. Are the scheduler settings right?
 *  Thread Starter [h-u-g-o](https://wordpress.org/support/users/h-u-g-o/)
 * (@h-u-g-o)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8329706)
 * Yes, they are right. The relevant widgets aren’t displayed on other pages in 
   the sidebar.
 *  Thread Starter [h-u-g-o](https://wordpress.org/support/users/h-u-g-o/)
 * (@h-u-g-o)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8329751)
 * The custom function with `get_sidebar()` resides within another plugin.
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8330340)
 * Please set a widget in another widget area for a check (you can remove it after
   the test). Does the scheduler work in that widget area?
 *  Thread Starter [h-u-g-o](https://wordpress.org/support/users/h-u-g-o/)
 * (@h-u-g-o)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8330430)
 * I’m not sure if I got you right. The scheduler works in the sidebar and also 
   in other widget areas. It only doesn’t work when the sidebar is called within
   another plugin’s function.
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8331140)
 * Thank you for your feedback. You have got me stumped. Currently I can not see
   a difference between calling `get_sidebar()` in a theme and calling it in your
   plugin. So at the moment I got no idea where to debug.
    -  This reply was modified 9 years, 7 months ago by [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/).
      Reason: corrected typo
 *  Thread Starter [h-u-g-o](https://wordpress.org/support/users/h-u-g-o/)
 * (@h-u-g-o)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8331151)
 * Could the order in which the plugins are loaded be the key?
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8331313)
 * I do not think so but I have no clue.
 *  Thread Starter [h-u-g-o](https://wordpress.org/support/users/h-u-g-o/)
 * (@h-u-g-o)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8339383)
 * Could it be because the sidebar is on a page like this?
 * `http://www.example.net/wp-admin/admin-ajax.php?action=...`
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8339894)
 * If I read the above URL correctly: In WP a sidebar.php can be loaded via Ajax.
   So the answer can be “no” but “yes” due to other reasons in this context. I am
   not an Ajax expert and could not provide any answer. Sorry.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Doesn’t work using get_sidebar() in custom function’ is closed to new
replies.

 * ![](https://ps.w.org/widget-visibility-time-scheduler/assets/icon-256x256.png?
   rev=2478534)
 * [Widget Visibility Time Scheduler](https://wordpress.org/plugins/widget-visibility-time-scheduler/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-visibility-time-scheduler/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-visibility-time-scheduler/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-visibility-time-scheduler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-visibility-time-scheduler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-visibility-time-scheduler/reviews/)

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * 10 replies
 * 2 participants
 * Last reply from: [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/doesnt-work-using-get_sidebar-in-custom-function/#post-8339894)
 * Status: resolved