Forum Replies Created
-
AuthorPosts
-
November 16, 2011 at 9:10 am in reply to: Homepage customization / including upcoming and past events #11168
Adam
MemberSo sorry Jonah, looks like your code is indeed working like a charm! I jumped to a wrong conclusion when I was checking the page. It’s fine! Thanks again!
(BTW I do have the query in there on line 66… this is for a different page, a newsletter that only lists upcoming events.)
All the best!
November 16, 2011 at 7:11 am in reply to: Homepage customization / including upcoming and past events #11157Adam
MemberThanks again Jonah! However, I’m trying to utilize your code and it simply returns all upcoming events, not just the ones in (in this case) the “selected” category. I tried:
$upcoming = tribe_get_events( array('eventDisplay'=>'upcoming', 'posts_per_page'=>-1, 'tax_query'=>array(array('taxonomy'=>'tribe_events_cat','field'=>'id','terms'=>5))));
Where the category is #5.
I also tried this based on the codex article, using “array (‘name-of-category’)”:
$upcoming = tribe_get_events( array('eventDisplay'=>'upcoming', 'posts_per_page'=>-1, 'tax_query'=>array(array('taxonomy'=>'tribe_events_cat','field'=>'id','terms'=>array ('selected')))));
But that provides no results at all.
Just for fun, here’s a link to the entire code: http://pastebin.com/zRk8YKU8
And the page in question: http://designerblowout.ca/mailout-selected
Hope you can point me toward my error! 8^)
November 14, 2011 at 3:16 pm in reply to: Homepage customization / including upcoming and past events #11075Adam
MemberThanks a million Jonah! Figures it would be something totally minor like that. D’OH!
That leaves only one roadblock remaining for me: can you advise on how to query for events that are in particular categories? I’ve defined “featured” and “mailout” categories, for example – both used in custom templates I created for newsletter mailouts. In the previous version of the plugin I could just query_posts for posts checked with these categories. How can I specify that now?
November 14, 2011 at 11:32 am in reply to: Homepage customization / including upcoming and past events #11054Adam
MemberThanks Rob for the quick reply. I totally get that you guys have limited resources and definitely appreciate the help you are able to provide. I’ll sit tight and wait for some more assistance.
Hopefully down the road much of this can be included in the documentation – along with nice clear example PHP code… assuming that my situation is just a matter of learning “how to” and isn’t some kind of bug or technical problem (hope not!).
Again, many thanks and looking forward to getting this sorted out.
November 14, 2011 at 10:22 am in reply to: Homepage customization / including upcoming and past events #11032Adam
MemberHey… guys. My client’s limping along with a broken 1.6.5 site and I REALLY need your help to get 2.0.1 working.
To reiterate where I’m at now, I just need the “full” code (fragments without context are not really helpful) to loop twice through events, once showing upcoming events and once showing past events. As well, I need to be able to display posts from particular categories on various e-newsletter templates.
For the first issue, I tried (as an alternate to what’s in the pastebin link above) copying the entire code from list.php into my home.php page to grab upcoming events, but there it tells me “no upcoming events”. When I go to the regular link for upcoming events though, I do see the correct list.
FYI, I am trying to learn what I can on my own – I found this article very promising, but at the end I still don’t know why my two loops are producing the same results:
http://digwp.com/2011/05/loops/
Five minutes of your undivided attention would be all it takes, I’m sure. I can also be available any time for a quick email or phone exchange. Let me know. I’m really in a corner here. Thanks!
November 12, 2011 at 2:35 pm in reply to: Homepage customization / including upcoming and past events #11006Adam
MemberThanks John – but the issue is actually that the upcoming and past events loops show the same events, no difference in the output. (I think I made some tweaks to the code since the time when that was the issue…)
Here is the code:
And here is what shows up:
November 11, 2011 at 11:40 am in reply to: Homepage customization / including upcoming and past events #10979Adam
MemberOne other addendum I realized I should mention sooner rather than later: my understanding is that getting posts this way produces “static” posts, i.e. they lack pagination. But I did have (and need) this for the homepage so people can click back and see that there is a rich history of events. This was no problem with query_posts, but can I also have that with the $upcoming and $past queries?
November 10, 2011 at 11:13 am in reply to: Homepage customization / including upcoming and past events #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!
November 10, 2011 at 11:07 am in reply to: Homepage customization / including upcoming and past events #10911Adam
MemberThanks so much Rob. My client is getting super-antsy!
November 10, 2011 at 1:39 am in reply to: Homepage customization / including upcoming and past events #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 1:05 am in reply to: Homepage customization / including upcoming and past events #10880Adam
MemberWhoa, that code didn’t paste very well. Here it is on Pastebin:
November 10, 2011 at 1:04 am in reply to: Homepage customization / including upcoming and past events #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 9, 2011 at 1:56 pm in reply to: Homepage customization / including upcoming and past events #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 8, 2011 at 4:59 pm in reply to: Homepage customization / including upcoming and past events #10776Adam
MemberNo worries, thanks for the swift update!
November 8, 2011 at 3:21 pm in reply to: Homepage customization / including upcoming and past events #10758Adam
MemberHey Rob – any chance of some feedback over the next day or so? Thanks!
-
AuthorPosts
