Home › Forums › Calendar Products › Events Calendar PRO › Conditional Tag Issues
- This topic has 15 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
January 3, 2013 at 7:42 am #30241
dalbeck
ParticipantHey Everyone,
So having some trouble getting specific elements in my sidebar file to show up on the Events List, Calendar and Single event details page. I have been scouring Google and the site for quite some time now.. closest I could find was on the WordPress forums:
I found this:
http://pastebin.com/5wfnWSZt
didn’t work.. only shows the sidebar items on the single event details page also tried modifying this to be:
http://pastebin.com/5kQA8CP8That didn’t work either. Any help would be great! Thank you.
January 3, 2013 at 7:51 am #30244Jonah
ParticipantHi Danny, does this help: https://gist.github.com/2415009
– Jonah
January 3, 2013 at 7:52 am #30245dalbeck
ParticipantYeah.. tried that too .. no luck =/
January 3, 2013 at 7:54 am #30246Jonah
ParticipantCan you share more examples or the full code you are working with? Please post to http://snippi.com/ or https://gist.github.com/
Thanks,
JonahJanuary 3, 2013 at 1:20 pm #30276dalbeck
ParticipantThis is my current sidebar file: http://snippi.com/s/7g3g9zh
January 3, 2013 at 2:19 pm #30277Jonah
ParticipantHmm, it looks like that should work. Have you tried taking out some of the conditions to see if any of them work? For example, stripping it all down to using just tribe_is_month() ?
– Jonah
January 4, 2013 at 7:06 am #30296dalbeck
ParticipantJonah,
I did try just doing them individually and that didn’t seem to work either.. any other thoughts? Right now on the Events List view my sidebar doesn’t display at all, and on the Calendar view it doesn’t either.
January 4, 2013 at 12:47 pm #30310Jonah
ParticipantOk Danny, sorry about that. Try this pattern instead:
if ( $query->query_vars['eventDisplay'] == 'upcoming' || $query->query_vars['eventDisplay'] == 'past' || $query->query_vars['eventDisplay'] == 'month' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
//your code here
}
Does that work at all?– Jonah
January 4, 2013 at 1:10 pm #30312dalbeck
ParticipantStill nothing, heres my whole sidebar: http://pastebin.com/gfZW9wyH
January 4, 2013 at 1:33 pm #30313Jonah
ParticipantHmmm, actually the last conditional code I posted doesn’t work for me in Genesis but the original conditional do… Have you tried deactivating all other plugins? I wonder if something else is interfering?
– Jonah
January 8, 2013 at 6:41 am #30419dalbeck
ParticipantJonah,
Yeah, I tried disabling a ton of plugins.. still nothing =/ any other ideas?
January 8, 2013 at 6:43 am #30420dalbeck
ParticipantSorry for double post.. just found this in my error logs:
Call to undefined function tribe_is_archive()I will play around with the conditional maybe that could be screwing it up?
January 8, 2013 at 7:45 am #30429dalbeck
ParticipantOk figured it out. Was missing a closing tag and calling 2 functions that didn’t exist: tribe_is_archive() and tribe_is_events. Once I deleted those from the condition everything works. Final line looks like this:
Hope this helps someone else… thanks for your help Jonah!
January 8, 2013 at 7:46 am #30430dalbeck
Participantif((get_post_type() == ‘tribe_events’ && tribe_is_upcoming()) || tribe_is_month() || tribe_is_by_date() || tribe_is_month() && !is_tax() ) {
— Sorry didn’t post in the last message.. really sorry for like 3 extra posts.
January 8, 2013 at 8:47 am #30432Jonah
ParticipantHey Danny,
Phew, glad to hear you figured it out. Let us know if you need anything else.
Thanks,
Jonah -
AuthorPosts
- The topic ‘Conditional Tag Issues’ is closed to new replies.
