Okay
  Public Ticket #3020056
Show number of entries
Closed

Comments

  •  5
    joshivince started the conversation

    Dear Zhivko,

    is it possible to add here (see screenshot) the number of overall entries of my calender? So that my visitors can see how many events my calendar has?

    Thanks for your support in advance,

    Vincent

  •  793
    Zhivko replied

    Some events can be repeated indefinitely and that would be a problem. 

    If you're not using the repeater I guess it won't be a problem.


    Stachethemes Developer

  •  793
    Zhivko replied

    The code:

    add_action('wp_footer', function () {
        if (!wp_script_is('stec-js')) {
            return;
        }     ?>
        <script type='text/javascript'>
            (function($) {             $(function() {                 $.stecExtend(function(m) {                     const eventsCount = m.calData.eventsPool.length;                     const cssStyle = [
                            'color: #bdc1c8',
                            'font-size: 14px',
                            'line-height: 45px',
                            'padding: 0 15px',
                            'background:#fff',
                            'border-radius: 3px',
                            'display: inline-block'
                        ];                     const html = [
                            '<div class="stec-top-menu">',
                            '   <span class="stec-top-events-count" style="' + cssStyle.join(';') + '">',
                            '   Entries: ',
                            eventsCount,
                            '   </span>',
                            '</div>',
                        ];                     $(html.join('')).insertAfter(m.$instance.$top.find('.stec-top-dropmenu-layouts'));                 }, 'onAddToEventsPool');             });         })(window.jQuery);
        </script>
    <?php });



    Stachethemes Developer

  •  5
    joshivince replied

    Thanks Mate. That worked. I don't have repeated events.

    This ticket can be closed.

    :)

    Vincent