Multiple instances of shortcode possible?

Home Forums Welcome! Pre-Sales Questions Multiple instances of shortcode possible?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1146101
    Brian Wood
    Guest

    I 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.

    #1146218
    Geoff
    Member

    Hey 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!
    Geoff

    #1146341
    Brian Wood
    Guest

    Hmmm… 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!

    #1146343
    Brian Wood
    Guest

    Hey, 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.

    #1146533
    Geoff
    Member

    That’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

    #1146535
    Geoff
    Member

    I should add that all of our documentation for Events Calendar PRO is available here:
    https://theeventscalendar.com/plugin/the-events-calendar-pro/

    #1154325
    Geoff
    Member

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Multiple instances of shortcode possible?’ is closed to new replies.