Home › Forums › Calendar Products › Events Calendar PRO › Show and Hide Content / Conditional Tags
- This topic has 5 replies, 2 voices, and was last updated 11 years, 4 months ago by
Brian.
-
AuthorPosts
-
December 5, 2014 at 2:12 am #908676
artworkcreative
ParticipantHi,
I am trying to add an additional function to the photo view of this plugin. I would like to add a show/hide option for the content below the image so that when the page loads it just shows the title, image and show/hide button to allow users to show text content before going into the detailed event page?
I have trialled a simple jquery toggle button system on the page but when the toggle button is clicked it only affects the first event regardless of which event button is selected, so if the system could be filtered down to individual events that would solve my issue?
Also is it possible to identify the events section, I tried to identify it by using is_post_type_archive() and other conditional tags but I cant find the right one. Example below:
<?php if (is_post_type_archive(‘events’)) { echo ” class=\”current\””; }?>
Thanks,
SamDecember 5, 2014 at 7:39 am #908899Brian
MemberHello,
I can help you out here. We do have a bunch of different conditionals that enable you to target specific views.
See if this list helps you out:
https://gist.github.com/jo-snips/2415009
Let me know if you have any follow up questions.
Thanks
December 6, 2014 at 2:02 pm #910332artworkcreative
ParticipantHi Brian,
Is there a conditional tag to cover all event views in one?
Thanks,
SamDecember 8, 2014 at 5:56 am #911591Brian
MemberHi Sam,
See my answer below:
Is there a conditional tag to cover all event views in one?
Nope, you can string them together into one statement.
If you look at this snippet it targets all the views:
https://gist.github.com/jesseeproductions/8d0947375b5ba10a1b5e
You will have to modify it to get it to do what you would like, but that will be close.
December 15, 2014 at 2:24 am #918262artworkcreative
ParticipantHi Brian,
Thank you for the information, I think I have found a work around it.
I have implemented an additional widget section within the events page template (only on events system) and then set the widget visibility to appear on all events pages with the link as active by default.
However when the user goes to a non event page, it will return to the automatic system for recognising pages and custom post types.
Thank you for your advice.
Sam
December 15, 2014 at 6:19 am #918431Brian
MemberThat sounds good. Glad you having it working the way you would like.
Since there is nothing more to do here for now I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.
Thanks
-
AuthorPosts
- The topic ‘Show and Hide Content / Conditional Tags’ is closed to new replies.
