Home › Forums › Calendar Products › Events Calendar PRO › Using widgets outside of the sidebar
- This topic has 6 replies, 3 voices, and was last updated 11 years, 6 months ago by
Barry.
-
AuthorPosts
-
September 3, 2014 at 12:31 pm #720000
maquina
ParticipantHi, I’m developing a premium theme to work with the The Events Calendar Pro and have hit a wall. I’m using ‘the_widget( )’ to render widgets, but the CSS is not loading. Here’s the link describing the issue: https://core.trac.wordpress.org/ticket/24283
Is there something you can suggest to work around this issue and call the CSS when widgets are rendered outside a sidebar?September 3, 2014 at 4:53 pm #720457Barry
MemberHi!
I have moved this across from the pre-sales forum to the Events Calendar PRO forum (since it looks like you’re a logged in user who has purchased a license) but the thread URL should remain the same and you should remain subscribed to email updates, if you opted in to receive them.
If use embed a widget using the_widget() then the supporting scripts and stylesheets should still be enqueued: can you confirm which of our widgets isn’t behaving in this regard and/or link to an example, so I can investigate further?
Thanks!
September 12, 2014 at 1:12 pm #740485maquina
ParticipantPlease refer to line 1165 of events-calendar-pro/events-calendar-pro.php the enqueue_styles() method, and in line 2129 of the-events-calendar/lib/the-events-calendar.class.php the loadStyle() method.
Both use the is_active_widget() function. And in wp-includes/widgets.php line 1140 the function is declared and used internally by wp_get_sidebars_widgets() as described here: http://codex.wordpress.org/Function_Reference/wp_get_sidebars_widgets .
This function retrieves the list of sidebars and its widgets, this means that is you use the_widget() it won’t work.
We already resolved this issue. We just wanted to let you know this could pose a problem in the future for your plugin and the_widget() function.
September 12, 2014 at 1:52 pm #740552Barry
MemberThanks for the follow-up!
Even so, if you have a moment to spare it would be most helpful if you could confirm which widget this was in relation to, as the code you referenced is not the only location through which CSS assets are set up (and when I test our this scenario with the Calendar Widget, for instance, it broadly works and appears as expected).
Thanks again!
September 18, 2014 at 6:30 pm #751867simpleconnections
ParticipantI’ve encountered this as well – I’ve got the following code to load the widget: <?php the_widget( ‘TribeEventsMiniCalendarWidget’ ); ?>
Then I’ve extended the theme by having a tribe-events folder under my theme with a tribe-events.css file. Should I be putting a widget css into a pro/widget/mini-calendar or somewhere in there? If I look at the source for my page, it doesn’t even appear to be loading my stylesheet at all. Is there a way to determine where in the list of stylesheets the tribe stylesheets get loaded?
September 19, 2014 at 6:43 am #752874Barry
MemberHi simpleconnections – I’m sorry you’re experiencing problems.
If you could create your own thread though that would be much appreciated as we often find that every case is different and it can get confusing if, for instance, we have several different voices in the same thread all at different point in the troubleshooting process (plus when you create a new thread you can share your URL etc safely without exposing it to the world).
Thanks!
October 7, 2014 at 8:56 am #794309Barry
MemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Using widgets outside of the sidebar’ is closed to new replies.
