Add something before/after events in Event List Widget

Home Forums Calendar Products Events Calendar PRO Add something before/after events in Event List Widget

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #57492
    rduncan10
    Participant

    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.

    #58339
    Rob
    Member

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

    #58479
    rduncan10
    Participant

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

    #58483
    snorton
    Participant

    rduncan10: 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/uxv11h7

    For more information on the the_widget function:
    http://codex.wordpress.org/Function_Reference/the_widget

    #58485
    snorton
    Participant

    I 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’
    )
    )
    )
    );

    #59835
    rduncan10
    Participant

    Thanks. I used your tribe_get_events query to create my own widget plugin for these types of events.

    #59986
    Leah
    Member

    Excellent, thank you snorton! rduncan10, are you all set here?

    #62796
    Rob
    Member

    You ever get a chance to check this out, rduncan10? We good here?

    #62862
    Joel
    Participant

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

    #62876
    Joel
    Participant

    I 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’ ); ?>, ,

    #62878
    Joel
    Participant

    Should’ve known that wouldn’t work. Here’s the code: http://snippi.com/s/gtoqgjo

    #63387
    Rob
    Member

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

    #980439
    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 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Add something before/after events in Event List Widget’ is closed to new replies.