Home › Forums › Calendar Products › Events Calendar PRO › Add something before/after events in Event List Widget
- This topic has 12 replies, 6 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
July 28, 2013 at 12:52 pm #57492rduncan10Participant
Is it possible to add content to the events list widget before or after the list of events. I’ve copied the list-widget.php file to my own theme and modified that. But anything I add to that appears once with each event. I want to add somethings outside the list.
For example, our organization hosts events for several external groups. I created a category for each group and created a new instance of the widget for each category. I want the widget to have a blurb about each organization before the list of their events. I realize I could add a simple Text/HTML widget before the event list widget, but then I end up with extra headings and the design isn’t really tied together.
Thanks.August 1, 2013 at 12:37 pm #58339RobMemberHi there rduncan10. I’m so sorry this one slipped through the cracks. I want to do what I can to get it sorted for you. I’m having a hard time conceptualizing exactly what it is you’re trying to do, though…would you mind sharing a link to the site showing what you’ve got so far so I can see this in action, and can get you a reply in as timely a fashion as possible?
Thanks!
August 2, 2013 at 7:12 am #58479rduncan10ParticipantOne example is that our hall hosts regular blood donor clinics for Canadian Blood Services. If you look at our homepage (www.ukclubcambridge.ca) and scroll down, you will see on the right a widget for the Canadian Blood Services. This is just a stock WordPress Text/HTML widget. Below that is a list of upcoming clinics. This is an Events List Widget filtered to only display the category I created for these clinics.
This setup is okay, but I’d like some way to join the two widgets. It might not be obvious from the design that the two widgets are connected. I would like to logo and blurb about Canadian Blood Services to appear in the same widget as the list of their upcoming clinics.
Thanks.August 2, 2013 at 7:29 am #58483snortonParticipantrduncan10: If you’re comfortable with php, you can use the_widget function to call the Tribe calendar in reference and simply use $args to adjust the output before the widget and after the widget using the following syntax (this outputs the list widget):
http://snippi.com/s/uxv11h7For more information on the the_widget function:
http://codex.wordpress.org/Function_Reference/the_widgetAugust 2, 2013 at 7:35 am #58485snortonParticipantI just realized you wanted it to be narrowed down by category as well. You’ll also want to set up an array that queries for the specific taxonomy you have created for that category:
tribe_get_events(
array(
‘eventDisplay’=>’upcoming’,
‘posts_per_page’=>5,
‘tax_query’=> array(
array(
‘taxonomy’ => ‘tribe_events_cat’,
‘field’ => ‘slug’,
‘terms’ => ‘cbs’
)
)
)
);August 10, 2013 at 8:16 am #59835rduncan10ParticipantThanks. I used your tribe_get_events query to create my own widget plugin for these types of events.
August 12, 2013 at 9:24 am #59986LeahMemberExcellent, thank you snorton! rduncan10, are you all set here?
August 26, 2013 at 9:54 am #62796RobMemberYou ever get a chance to check this out, rduncan10? We good here?
August 26, 2013 at 12:52 pm #62862JoelParticipantI’d also love to know how to do what he asked originally: To add content before or after the widget. I’m a front-end guy, and can only hack in php, so I’m not following what snorton suggested. I’ve tried adding a php widget to wordpress and putting his code in, but with no success.
August 26, 2013 at 1:26 pm #62876JoelParticipantI ended up getting this to work for my situation. Hope it helps someone else:
global $post;
$all_events = tribe_get_events(array(
‘eventDisplay’=>’3’,
‘posts_per_page’=>-1
));foreach($all_events as $post) {
setup_postdata($post);
?><a href="”> ‘alignleft’) ); ?>
<a href="”>
ID, false, ‘M j, Y’ ); ?>, ,
August 26, 2013 at 1:28 pm #62878JoelParticipantShould’ve known that wouldn’t work. Here’s the code: http://snippi.com/s/gtoqgjo
August 28, 2013 at 10:45 am #63387RobMemberExcellent to hear you ultimately got this sorted, Joel, and sorry you had to figure it out on your own. Your solution looks solid and will surely be of use to others in the same position down the road. Cheers.
July 7, 2015 at 6:27 am #980439Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Add something before/after events in Event List Widget’ is closed to new replies.