Tribe_mini_calendar show multiple 5 items and hide calendar

Home Forums Calendar Products Events Calendar PRO Tribe_mini_calendar show multiple 5 items and hide calendar

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #964378
    hypnotiqart
    Participant

    Sorry, but this is a continuation from the last forum:

    https://theeventscalendar.com/support/forums/topic/tribe_mini_calendar-shortcode-show-5-upcoming-events/

    I tried it, but it didn’t work. I guess I’m not sure what Geoff is referring too in the code. I’m not sure where to put the code.

    I was able to hide the calendar by setting the display: none; in the css.

    Now all I want to do is show the list below (limited to 5) from multiple months.

    I tried Event Rocket, but it displays too much information. I like the cleanliness of the shortcode, but I can’t get it to do what I want.

    Can someone please supply me with a simple solution.

    #964476
    Geoff
    Member

    Hello there, hypnotiqart!

    Yeah, I know that can be a little tricky.

    The snippet I provided in the last thread belongs in a template–that means you would add it to the page template of your choice (or a new one) as opposed to adding it directly to the page or post you’re working on.

    We are definitely looking into adding more shortcodes to the mix (such as the list widget) but that’s unfortunately down the road. Event Rocket is still the cleanest way to add an event or calendar directly to a page or post with a shortcode for the time being.

    Let me know if you still have questions here and I’ll do my best to help out. 🙂

    Cheers!
    Geoff

    #964560
    hypnotiqart
    Participant

    Thanks for your quick response Geoff,

    Where do I put the code you mentioned. Can you please let me know where in the theme or specifically where I should put the code you mentioned?

    #964806
    Geoff
    Member

    Sure thing–yeah, the snippet I mentioned would go directly in a page template of your choice. Which one exactly can vary depending on where you want the event list to display.

    For example, if you want the event list to display on other events, then you would add it to the single-event.php template. Similarly, if you wanted it to display on all other pages of your site, then you could place it in page.php.

    I hope this helps!

    Geoff

    #965557
    hypnotiqart
    Participant

    Thanks Geoff!
    Last dumb question. Does it go in the header area or somewhere else?

    Thanks

    #965631
    Geoff
    Member

    Not a dumb question at all! However, it all depends on your template and layout. The code should go where you want it to go on the page/template. You may need to fiddle around with it a bit to position it just right. 🙂

    Cheers!
    Geoff

    #965927
    hypnotiqart
    Participant

    I tried putting your code in page.php, but it still does not work. Can I privately send you the file so that you can see what I’m doing wrong?

    // Ensure the global $post variable is in scope
    global $post;

    // Retrieve the next 5 upcoming events
    $events = tribe_get_events( array(
    ‘posts_per_page’ => 5,
    ‘start_date’ => new DateTime()
    ) );

    // Loop through the events: set up each one as
    // the current post then use template tags to
    // display the title and content
    foreach ( $events as $post ) {
    setup_postdata( $post );

    // This time, let’s throw in an event-specific
    // template tag to show the date after the title!
    the_title();
    echo tribe_get_start_date();
    the_content();
    }

    #965989
    Geoff
    Member

    Will you try putting this at the very start of the snippet:

    <?php

    …and this at the very end:

    ?>

    I think that should do the trick. 🙂

    Geoff

    #969073
    Geoff
    Member

    Hey there, hypnotiqart! This thread has been quiet for a couple of weeks, so I’m going to go ahead and close it. I hope wrapping the snippet in the code above worked out, but please feel free to start a new thread if you still have any questions here and we’d be happy to help. 🙂

    Cheers!
    Geoff

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Tribe_mini_calendar show multiple 5 items and hide calendar’ is closed to new replies.