Home › Forums › Calendar Products › Events Calendar PRO › Tribe_mini_calendar show multiple 5 items and hide calendar
- This topic has 8 replies, 2 voices, and was last updated 8 years, 10 months ago by Geoff.
-
AuthorPosts
-
May 21, 2015 at 6:30 pm #964378hypnotiqartParticipant
Sorry, but this is a continuation from the last forum:
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.
May 22, 2015 at 7:54 am #964476GeoffMemberHello 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!
GeoffMay 22, 2015 at 11:00 am #964560hypnotiqartParticipantThanks 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?
May 25, 2015 at 8:20 am #964806GeoffMemberSure 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
May 27, 2015 at 8:07 pm #965557hypnotiqartParticipantThanks Geoff!
Last dumb question. Does it go in the header area or somewhere else?Thanks
May 28, 2015 at 7:05 am #965631GeoffMemberNot 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!
GeoffMay 28, 2015 at 7:35 pm #965927hypnotiqartParticipantI 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();
}May 29, 2015 at 7:01 am #965989GeoffMemberWill 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
June 12, 2015 at 8:38 am #969073GeoffMemberHey 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 -
AuthorPosts
- The topic ‘Tribe_mini_calendar show multiple 5 items and hide calendar’ is closed to new replies.