Home › Forums › Calendar Products › Events Calendar PRO › How can I remove the List Widget's title?
- This topic has 4 replies, 2 voices, and was last updated 11 years, 4 months ago by
Barry.
-
AuthorPosts
-
January 13, 2015 at 6:27 pm #932397
Steve
ParticipantHi,
I’ve been looking through the forums, knowledge base, customization pages, etc for a few hours now trying to figure out how I can remove the “Upcoming Events” title from the List Widget (Events Calendar Pro). Actually, not just the text, I want to remove the actual section and div around it. I’m sure I’m just missing something, but nevertheless want to ask here…Note, I am looking to remove/edit the actual code (Not where “Upcoming Events” is defined as part of the title variable — I was able to find that — but rather where it actually appears as part of the section class/div class widget wrapper).
Could you please point me to the correct file to do that?
Hopefully that was clear, happy to provide further details to clarify the question if not. Thanks!
January 14, 2015 at 5:48 am #932576Barry
MemberHi Steve,
Great question!
The wrapper around the title is something that, ordinarily, is specified by your theme – but you can control this via various WordPress hooks:
add_filter( 'widget_display_callback', 'modify_list_widget_title', 10, 2 ); add_filter( 'dynamic_sidebar_params', 'modify_list_widget_wrapper' ); function modify_list_widget_title( $params, $widget ) { $is_regular_list = ( 'tribe-events-list-widget' === $widget->id_base ); $is_advanced_list = ( 'tribe-events-adv-list-widget' === $widget->id_base ); if ( ! $is_advanced_list || ! $is_regular_list ) return; $params['title'] = ''; return $params; } function modify_list_widget_wrapper( $widget ) { if ( ! isset( $widget[0]['widget_id'] ) ) return $widget; $is_regular_list = ( 0 === strpos( $widget[0]['widget_id'], 'tribe-events-list-widget' ) ); $is_advanced_list = ( 0 === strpos( $widget[0]['widget_id'], 'tribe-events-adv-list-widget' ) ); if ( ! $is_advanced_list || ! $is_regular_list ) return $widget; $widget[0]['before_title'] = ''; $widget[0]['after_title'] = ''; return $widget; }Does that work for you (you could place the code above within your theme’s functions.php file, for instance)?
January 14, 2015 at 6:44 am #932601Steve
ParticipantBrian,
Thanks for the quick reply. Unfortunately this doesn’t make any noticeable changes.When I view source for my site I see this code:
<div class=”widget tribe-events-adv-list-widget”><h2 class=”widgettitle”>Upcoming Events</h2>
Trying to figure out where that code is coming from…
Could be from my original theme and I’m just missing it, but if it’s coming from an events calendar/events calendar pro file I would love to go in and edit directly.
January 14, 2015 at 7:20 am #932623Steve
ParticipantOk, I actually just changed the title to null in adv list widget class, and will just mess around with the CSS styling of that widget class so am all set. Thanks again!
January 14, 2015 at 10:56 am #932842Barry
MemberNo worries – glad you’re all set 🙂
-
AuthorPosts
- The topic ‘How can I remove the List Widget's title?’ is closed to new replies.
