Home › Forums › Calendar Products › Events Calendar PRO › Homepage customization / including upcoming and past events
- This topic has 33 replies, 6 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
November 3, 2011 at 1:44 am #10520
Adam
MemberHi! I created a non-public version of my client’s site in order to get everything hunky-dory with the new TEC; once that’s working, I’ll switch everything over. It’s almost all working, except for the all-important home page. Right now, nothing shows up at all there.
http://designerblowout.ca/blowout/
I used to have upcoming events (a thumbnail and the excerpt) on my homepage, followed by titles only of past events. That’s what I’d like to duplicate. It can still be seen at the active, live site, running 1.6.5 of TEC:
I’ve seen discussions here re: including events on the homepage. Unfortunately I can’t quite wrap my head around what I’ve seen. I don’t need to mix “normal posts” and events, the site is all events, but my old custom index.php is clearly irrelevant now. Trouble is, I have no idea how to fix it or which file to steal the code from. Standard “Query_posts” stuff I could handle. But I’m lost now.
Once I have this sorted, I’ll be ready to rock. Hope someone can help! Thanks!
Adam
November 3, 2011 at 5:15 pm #10560Rob
MemberHey Adam. I can try and help you out here; this one is probably best to have our developer, John, take a look at. He’s out today and tomorrow but is back addressing support issues over the weekend, so I should be able to get you a response on this by Monday or Tuesday. Apologies I couldn’t offer up anything in the shorter term.
November 3, 2011 at 6:09 pm #10563Adam
MemberThanks Rob, it’s definitely gratifying to know that help is on the way!
By way of a little more detail and background, I have tried using the code in this post on my home.php:
But I find that it produces a list of ALL events, starting with the upcoming ones and just continuing down the line with past ones. Ouch!
I also see some code in there that sort of cryptically refers to the list.php template:
Yet it’s inactive due to the comment marks, and when I remove them just for fun, I get a notice on the resulting page that there are “no upcoming events” – even though viewing the proper events page, I get an accurate and correct list!
Yikes.
So, bottom line, as I’ve said, I guess I’m out of my depth here…. the old copy and paste tricks not working. Client is quite keen (to put it mildly) to have his site working right – so really looking forward to assistance in the next few days. Thanks!
November 4, 2011 at 3:57 pm #10617Rob
MemberExcellent. That’s extremely helpful; thanks for the follow-up. It definitely doesn’t sound to be behaving as it should.
November 8, 2011 at 3:21 pm #10758Adam
MemberHey Rob – any chance of some feedback over the next day or so? Thanks!
November 8, 2011 at 4:04 pm #10773Rob
MemberHey Adam. Still got a dev looking at this (he was out last week, so we’re a bit backlogged)…and have just sent it to someone else to see if he’s got any feedback, so we can expedite things. Should definitely have a response over the next day or two – apologies for the delay in the interim.
November 8, 2011 at 4:59 pm #10776Adam
MemberNo worries, thanks for the swift update!
November 9, 2011 at 6:36 am #10788John
MemberHi Adam,
To accomplish what you are looking for you should be able to do in 2 custom queries:
$upcoming = tribe_get_events( array(‘eventDisplay’=>’upcoming’) );
$past = tribe_get_events( array(‘eventDisplay’=>’past’) );
You can loop through those events like you would with any get_posts call.
November 9, 2011 at 1:56 pm #10838Adam
MemberThanks John! However, I just need a tiny bit more help to implement this as I don’t yet know what to do with these isolated snippets. I’ve only really used query_posts up to now and don’t know the syntax for custom queries. I did an online search, but see lots of VERY different approaches – using WP_Query, a “Custom Select Query”, etc.
I’m going to have to finally settle in with a good WP book and dig deep into these sorts of beyond-the-basics customizations. But in the meantime… could you kindly share the full code for getting my excerpts?
THANK YOU!
November 10, 2011 at 1:04 am #10879Adam
MemberHmm, my “THANK YOU!” was meant to be exuberant but now looks more passive-aggressive… anyhoo, I’ve had a whack at it but nothing’s happening…. here is my no-doubt-totally-muddled attempt… can you point me in the right direction? Thanks!
’past’) );
$custom_posts = get_posts($past);
foreach($custom_posts as $post) : setup_postdata($post); ?><?php the_title('‘, ‘‘); ?>
<?php
if ( has_post_thumbnail() ) {
echo '‘;
the_post_thumbnail(‘listingThumb’);
echo ‘‘;
the_excerpt();
} else {
echo the_excerpt();
}
?>November 10, 2011 at 1:05 am #10880Adam
MemberWhoa, that code didn’t paste very well. Here it is on Pastebin:
November 10, 2011 at 1:39 am #10883Adam
MemberOK, sorry for the last 2 extraneous posts but here is my NEW, most successful attempt; however, I’m still getting only the same, past events in both loops:
Here is how it looks:
http://designerblowout.ca/blowout/
I’ve created a new event in December but it doesn’t show up….
Thanks again!
adamNovember 10, 2011 at 9:24 am #10895Rob
MemberHey Adam. Just a heads up that I’ve got John looking at this now, so he should have a response for you shortly.
November 10, 2011 at 11:07 am #10911Adam
MemberThanks so much Rob. My client is getting super-antsy!
November 10, 2011 at 11:13 am #10912Adam
MemberSince I know this is going to come up, perhaps I should mention now that once the front page loops are working, I also need to replicate one other kind of loop I was using before – on certain pages, intended for e-mailouts, where I extract only upcoming events in particular categories. It was all based on the old “standard” query_posts code but I can tell that it won’t work that way now (though my custom categories are still there, and ready to be checked, on Event posts). So if I can also get direction on how to show only upcoming events from a particular category, that would be great. Thanks!
-
AuthorPosts
- The topic ‘Homepage customization / including upcoming and past events’ is closed to new replies.
