Using widgets outside of the sidebar

Home Forums Calendar Products Events Calendar PRO Using widgets outside of the sidebar

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #720000
    maquina
    Participant

    Hi, 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?

    #720457
    Barry
    Member

    Hi!

    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!

    #740485
    maquina
    Participant

    Please 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.

    #740552
    Barry
    Member

    Thanks 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!

    #751867
    simpleconnections
    Participant

    I’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?

    #752874
    Barry
    Member

    Hi 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!

    #794309
    Barry
    Member

    Hi! 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!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Using widgets outside of the sidebar’ is closed to new replies.