Change class that a widget uses

Home Forums Calendar Products Change class that a widget uses

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #847859
    kqed
    Participant

    How do I customize pro/widgets/list-widget.php so that it uses a different class name for the widget? I don’t want to change the plugin files but can’t see an easy way to do it. If there’s not an easy way, how do I add my CSS to override the existing CSS?

    #848245
    Josh
    Participant

    Hello kqed,

    Thanks for reaching out to us!

    The widgets can be customized by copying the necessary view into your child theme using the instructions from our Themer’s Guide. In this case, you can copy the list-widget.php file into your theme at the following location tribe-events -> pro -> widgets -> list-widget.php. You can then add your custom class directly to the file.

    Let me know if this helps.

    Thanks!

    #853049
    kqed
    Participant

    I have done that already, and made a themed version of the list widget, but it won’t let me change the class that’s assigned to the <aside> part. This is what I want:
    <aside id=”tribe-events-adv-list-widget-2″ class=”widget widget_top-posts”>
    </aside>

    I’ve had to change a plugin file from the /lib directory to get it to output that way and don’t want my changes overwritten when we upgrade the plugin.

    #853568
    Josh
    Participant

    Hello kqed,

    Thanks for following up with us!

    The section that you would like to customize is actually controlled by your theme when widget areas are registered. If you look where sidebars are registered within your theme, you’ll see that within the “register_sidebar()” function there are two options, “before_widget” & “after_widget” that control what wraps the widget. This is where you can control the class for widgets.

    If you need more granular control on a widget by widget basis, you can check out this plugin to see if it helps to get what you’re looking for. I hope this helps.

    Thanks!

    #983572
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Change class that a widget uses’ is closed to new replies.