Okay
  Public Ticket #2457784
Remove the location/timespan in grid view
Closed

Comments

  •  1
    marcryu started the conversation

    Hi, is it possible to remove the location and/or timespan in grid view with css, so that only the title and short description are showing? This is to ensure that the layout is less overwhelming and text-heavy.

    If it cannot be remove, is it possible to style the text for timespan and location with css? I tried modifying the text settings in Tooltips but to no avail.

    Any advice will be appreciated. Thanks so much!

    Dom

  •  783
    Zhivko replied

    Hi,

    Open your theme/child-theme functions.php file and insert following filter:

    add_action('wp_footer', function() {
        
        global $post;
        
        if (!is_a($post, 'WP_Post') || !has_shortcode($post->post_content, 'stachethemes_ec')) {
            return;
        }
        
        ?>
        <script type="text/javascript">
            (function ($) {
                
                if (typeof $.stecExtend === 'undefined') {
                    return;
                }
                
                $.stecExtend(function(m){
                    var $template = $(m.glob.template.gridevent);
                    $template.find('.stec-layout-grid-event-ul').remove();
                    m.glob.template.gridevent = $template.get(0).outerHTML;
                });
            })(window.jQuery);
        </script>
        <?php
    });



    Stachethemes Developer

  •  1
    marcryu replied

    Hi Zhivko,

    Brilliant! Thanks so much for the snippet!

    In the event that my client just want the location removed and just keep the timespan, is it possible? Just in case, so I won't be a bother next time :)

    Cheers

    Dominic

  •  783
    Zhivko replied

    Hi,

    This will keep only the date line:

    add_action('wp_footer', function() {
        
        global $post;
        
        if (!is_a($post, 'WP_Post') || !has_shortcode($post->post_content, 'stachethemes_ec')) {
            return;
        }
        
        ?>
        <script type="text/javascript">
            (function ($) {
                
                if (typeof $.stecExtend === 'undefined') {
                    return;
                }
                
                $.stecExtend(function(m){
                    var $template = $(m.glob.template.gridevent);
                    $template.find('.stec-layout-grid-event-ul').children(':not(.stec-layout-grid-date)').remove();
                    m.glob.template.gridevent = $template.get(0).outerHTML;
                });
            })(window.jQuery);
        </script>
        <?php
    });


    Stachethemes Developer