add_action('wp_footer', function() { ?> <script type="text/javascript"> (function ($) { if (typeof $.stecExtend !== 'function') { return; } $.stecExtend(function (m) { if (m.glob.options.view === 'boxgrid') { m.$instance.$boxgrid.find('.stec-layout-boxgrid-event').each(function () { var id = parseInt($(this).attr('data-id'), 10); var event = m.calData.getEventById(id); if (event.location) { var html = '<span class="stec-layout-boxgrid-event-location">' + event.location + '</span>'; $(html).insertAfter($(this).find('.stec-layout-boxgrid-event-title')); } }); } }, 'onLayoutSet');
$.stecExtend(function (m) {
m.$instance.$boxgrid.find('.stec-layout-boxgrid-events-all-load-more').on('click', function () { m.$instance.$boxgrid.find('.stec-layout-boxgrid-event').each(function () {
if ($(this).find('.stec-layout-boxgrid-event-location').length > 0) { return true; //continue }
var id = parseInt($(this).attr('data-id'), 10); var event = m.calData.getEventById(id); if (event.location) { var html = '<span class="stec-layout-boxgrid-event-location">' + event.location + '</span>'; $(html).insertAfter($(this).find('.stec-layout-boxgrid-event-title')); } }); });
});
})(jQuery); </script> <?php });
Hello,
I love the "boxgrid" view for the event, but sadly the address of the event doesn't show on the "boxgrid" view (while the "grid" view does it).
There are a way to show the address directly on the "boxgrid" view?
Hi,
Try following:
Open your theme functions.php file and at the bottom add:
Stachethemes Developer
Thanks!
It's work fine for the first results. But for the results that appears after clicking on "show more", addresses are NOT shown on the new results.
Did you see a way to apply this change at all my events?
My page: https://www.pickactivity.com/agenda-kids-family/
Replace the old code with this one:
Stachethemes Developer
Perfect! Thank you very much.