Home › Forums › Welcome! › Pre-Sales Questions › Multiple instances of shortcode possible?
- This topic has 6 replies, 1 voice, and was last updated 9 years, 9 months ago by
Geoff.
-
AuthorPosts
-
August 1, 2016 at 8:16 am #1146101
Brian Wood
GuestI need to figure out if something is possible before I commit to TEC for a project. I have a design that uses embedded event lists throughout a site. These will come in two different designs. Specifically, it’s for a church where the home page will have an embedded event list with one design while each ministry or organization will have a page with an embedded events list with a different design.
I know (I think?) I can customize the event list widget in my child theme, but is there a way to add essentially a second shortcode with a different design? Obviously, I’m sure it will require coding and customization, but I just want to be sure it’s possible and get some direction on where to get started to do it.
August 1, 2016 at 11:48 am #1146218Geoff
MemberHey Brian,
Great question! Yes, you can embed multiple instances of the Events Calendar PRO widget shortcodes. As far as overriding the template, there is only one set of templates per widget to override (and, yes, correctly in the child theme!). If you’re looking to completely change the markup of the same widget in multiple places, then I think that would be a limitation you’ll run into — however, if you’re changing styling and are ok with using CSS to alter the layout, then I think you will be just fine because you can use a page’s body class to target a specific widget instance.
Does this make sense and will it work for you? Please let me know. :O)
Cheers!
GeoffAugust 1, 2016 at 5:42 pm #1146341Brian Wood
GuestHmmm… Ok, so I’ll need to think about it a little because I actually want them to be structurally different, not just stylistically. I might be able to do it with css but I’m going to have to get creative. Ok, thanks!
August 1, 2016 at 5:45 pm #1146343Brian Wood
GuestHey, actually, here’s a question: how would I programmatically (like in the modified PHP) query to show for only the first instance of a recurring event? I know I can do it with the switch in the backend dashboard but I think I can actually solve my problem by making a simple widget plugin for one of the structures.
August 2, 2016 at 7:58 am #1146533Geoff
MemberThat’s a good question — I know the code for that is in Events Calendar PRO here:
/wp-content/plugin/events-calendar-pro/src/functions/template-tags/general.php
…and you would likely want to re-cycle that logic to build upon your own.
Geoff
August 2, 2016 at 8:00 am #1146535Geoff
MemberI should add that all of our documentation for Events Calendar PRO is available here:
https://theeventscalendar.com/plugin/the-events-calendar-pro/August 22, 2016 at 7:00 am #1154325Geoff
MemberHey Brian, I see my last reply was marked as the correct answer. I’ll go ahead and close this thread but please feel free to let us know if any other questions pop up and we’d be happy to help. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘Multiple instances of shortcode possible?’ is closed to new replies.
