Okay
  Public Ticket #1761117
default test, if no event
Closed

Comments

  • benoit started the conversation

    hello

    source code :  [stachethemes_ec view="agenda" show_top=0 agenda_cal_display=0 cal=142 cat=6]


    if there is event for this category, this plugin is displayed

    but if no event, the place is empty ( white page ) , how to have a message just to say for example : "there is no event for now" ?


    thx


  •  894
    Zhivko replied

    Hi,

    Place this code in your theme functions.php file at the bottom:

    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                if (typeof $.stecExtend !== 'function') {
                    return;
                }
                $.stecExtend(function (master) {
                    if (master.calData.eventsPool.length <= 0) {
                        
                        var text = "There is no event for now";
                        
                        $('<p> ' + text + ' </p>').appendTo(master.$instance);
                    }
                }, 'onAddToEventsPool');
            })(jQuery);
        </script>     <?php
    });



    Stachethemes Developer