Forum Replies Created
-
AuthorPosts
-
alingParticipant
Thanks Casey!
That helped! It was only a simple if else statement. Thank you very much!!alingParticipantOkies, I think I will keep it simple and just remove the next/prev options. Instead I just added my own button of calendar view and past events.
My question about that is, when I’m on the past events page, it still shows “past events” and “calendar view” buttons. I would I be able to do an if statement based on if the page I’m on is displaying past events?
I wanted to write something like, if events being displayed/url == past, show only calendar view button, else show both button.
August 4, 2014 at 12:39 pm in reply to: Events Calendar Pro & SiteOrigin's Page Builder Widget #580279alingParticipantI was able to get get help via stackoverflow.com. Someone rewrote my code and it’s working fine now.
August 4, 2014 at 10:38 am in reply to: Events Calendar Pro & SiteOrigin's Page Builder Widget #579509alingParticipantWell the existing widget is perfectly fine, however, I would like to be able to select which event will display based on whether the additional field I set is Yes or No.
I guess I will just have to play around with it. I can write it out no problem if I made my own homepage template but I’m using Site Origin’s homepage builder widget stuff and I was trying to make things a little easier for the user who will be updating the site vs them having to deal with html code and possibly messing up the site.
alingParticipantGot it. I will try that out when I get back on the project sometime today. Thank you!
August 1, 2014 at 4:30 pm in reply to: Events Calendar Pro & SiteOrigin's Page Builder Widget #560740alingParticipantThis is what I came up with but it’s still not right:
<div class="tribe-venue-widget-wrapper">
-
<?php while ( $events->have_posts() ): ?>
<?php $events->the_post();
foreach($events as $event){
setup_postdata($event);
$id=get_the_ID();
$showOnHomepage=get_post_meta($id,'_ecp_custom_4',true);
date_default_timezone_set('America/Los_Angeles');
$todayDate = date("Y-m-d H:i:s");
$eventDate=get_post_meta($id,'_EventEndDate', "Y-m-d H:i:s");
if (($showOnHomepage == 'Yes') && ($eventDate >= $todayDate)) {
$link=get_permalink($id);
echo "
- "; the_post_thumbnail('medium'); echo " "; } } ?> <?php endwhile; ?> <div style="clear:both"></div>
August 1, 2014 at 4:14 pm in reply to: Events Calendar Pro & SiteOrigin's Page Builder Widget #560669alingParticipantHi Barry-
Thanks for getting back to me. I actually want to be able to see if the custom field is set, if it is, then I want that event to display on the homepage (which is the first set of code above that I’m using on our other site not in the venue-widget.php).
I guess my problem is not knowing how to write that into the 2nd set of code I have above because I don’t understand what $events->have_posts() is. Like I understand while events have post but how do I incorporate an if statement within a while loop? Or is that beyond the scope?alingParticipantOkies, thank you!
August 1, 2014 at 4:00 pm in reply to: Weird design changes – no columns, images look strange #560579alingParticipantIs there a way to make it 4 column?
alingParticipantSo instead, I ended up adjusting the nav piece saying if the date of the event is past todays date, change the copy to say “View Past Events” and vice versa.
I have 15 events set for each page. My problem now is that, when I go to events page, even though I only have 9 events listed, the navigation piece keeps showing “Next Events” when there is none. How do I write it, so that the navigation doesn’t display if there are no more events?
Here is what I have. I took out the a tag so that the code would display nicely on here.
<?php $id=get_the_ID(); date_default_timezone_set('America/Los_Angeles'); $todayDate = date("Y-m-d H:i:s"); $eventDate=get_post_meta($id,'_EventEndDate', "Y-m-d H:i:s"); ?> <?php if($eventDate >= $todayDate) :?> <li class="tribe-events-nav-previous"><?php _e( '<span>«</span> View Past Events', 'tribe-events-calendar-pro' ) ?> <?php else : ?> <li class="tribe-events-nav-previous"><?php _e( '<span>«</span> Previous Events', 'tribe-events-calendar-pro' ) ?> <?php endif;?> <!-- Display Next Page Navigation --> <?php if($eventDate <= $todayDate) :?> <li class="tribe-events-nav-next"> <?php _e( 'View Current Events <span>»</span>', 'tribe-events-calendar-pro' ) ?> <!-- .tribe-events-nav-next --> <?php else : ?> <li class="tribe-events-nav-next"> <?php _e( 'Next Events <span>»</span>', 'tribe-events-calendar-pro' ) ?> <?php endif;?>
alingParticipantPerhaps you can even just take out “$post” in the data-tribejson. Not sure. Would have to play around with it. But I think that piece is how the calendar gets the data as far as the post thumbnail and link.
alingParticipantI know that the tooltip display for calendar view is displayed via plugins > the events calendar > views > months > single-event.php.
I tried removing this piece “data-tribejson='<?php echo tribe_events_template_data( $post );” but it didn’t seem to work so I just used the CSS and set the tooltip piece to display: none;
alingParticipantJust wanted to say thank you Casey for giving me an idea. I was able to add to my existing code so that on our homepage, any event end date/time that is < current date/time will fall off. Now I do not have to work on weekends! lol.
alingParticipantForgot to close this out.
alingParticipantAlright, so here is what I wrote and it seemed to work but am no sure if this is correct way of writing it or not.
$todayDate = date(“Y-m-d H:i:s”);
$eventDate=get_post_meta($id,’_EventStartDate’, “Y-m-d H:i:s”);
if ((strtolower($linkr)==’yes’) && ($eventDate >= $todayDate)) -
AuthorPosts