Okay
  Public Ticket #1906519
shortcode for only organizer calendar
Closed

Comments

  • Rodolphe1150 started the conversation

    Hi. 

    I want to add a "Organizer page" for all event organizers on my website. 

    I don't find a shortcode to show only the calendar of only one organizer of the upcoming events.

    Can you help me with that?

  •  877
    Zhivko replied

    Hi,

    You will have to write some custom code.

    In your theme functions.php file add following code at the bottom:

    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                if (typeof $.stecExtend !== 'function') {
                    return;
                }
                $.stecExtend(function (m) {                 var filter = [];                 if (m.glob.options.organizer) {
                        $.each(m.calData.eventsPool, function () {
                            var event = this;
                            if (this.organizers.length > 0) {
                                $.each(this.organizers, function(){
                                    if (this.name === m.glob.options.organizer) {
                                       filter.push(event);
                                    }
                                });
                            }
                        });
                        
                         m.calData.eventsPool = filter;
                    }             }, 'onAddToEventsPool');
            })(jQuery);
        </script>
        <?php
    });

    Then in your shortcode add organizer attribute and insert the organizer name (case sensitive). 

    Example:

    [stachethemes_ec organizer="John Doe"]

    It should display only events with this organizer.


    Stachethemes Developer

  •   Rodolphe1150 replied privately
  •   Rodolphe1150 replied privately
  •   Rodolphe1150 replied privately
  •  877
    Zhivko replied

    Replace agenda_get_n with grid_per_click:

    [stachethemes_ec organizer="Babytwins" grid_per_click=4] 

    Have you included the code I've sent you earlier in your theme functions.php file at the bottom because I don't see it on your page?


    Stachethemes Developer

  • Rodolphe1150 replied

    Yes, the custom code disapear... I didn't know that will happen after Theme update!

    It's works fine now. Thanks to you.

  • Rodolphe1150 replied

    Hi.

    The shortcode [stachethemes_ec organizer="Babytwins" grid_per_click=4] was working since you give it to me but now I doesn't work anymore.

    What could be the problem?


    Kind regards.

  • Rodolphe1150 replied

    Sorry, my fault. The update of my theme made by a friend  delete the code on the php file again!