Hide Featured Image from Featured Events Widget

Home Forums Calendar Products Events Calendar PRO Hide Featured Image from Featured Events Widget

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1558333
    ftww
    Participant

    Hi There,

    Please can you let me know a way to hide the images from events list widget.
    In this particular instance the events list is limited to featured events only and appears just under the header image on the front page to the right.

    Many thanks in advance

    #1558751
    Cliff
    Member

    Hi. Are you wanting to hide them via CSS or not even load the images via PHP?

    If CSS, please link to the page displaying the widget so I can provide you a CSS snippet.

    If PHP, you’ll need to follow along our Themer’s Guide to override one of these 2 files:

    • /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/list-widget.php
    • /wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php
    #1558960
    ftww
    Participant

    Hi Cliff,

    Thanks for coming back. I would rather do via PHP.
    I’ve identified the list-widget.php in Pro, but when you say to override the file (note that I understand – the basic process of using themers guide) – I can see no reference contained within the file to images – is there a particular line I should be removing or some further specific instructions on this?

    I’m happy enough to use CSS either as the widget is limited to just 3 featured events on the homepage – location as described above – but here’s the link also: http://foodthewaterfordway.com/

    Thanks in advance

    #1559574
    Cliff
    Member

    Copy /wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php to your child theme, as described in the Themer’s Guide.

    Find <div class="tribe-event-image"> in that file and remove this section of the file.

    Please let me know if this works for you.

    #1572326
    ftww
    Participant

    Hi Cliff,
    Apologies for delay am just returning to this project now.
    I have tried the above and have copied list-widget.php to my child theme in to my file-events folder. I was was slightly unsure of which exact section to remove. Can you please specify the exact section and lines to remove as what I had removed doesn’t seem to have done the trick.

    The section of code is as follows – so if you could clarify which needs to come out I’d be grateful

    $featured_image_link = apply_filters( ‘tribe_events_list_widget_featured_image_link’, true );
    $post_thumbnail = get_the_post_thumbnail( null, $thumbnail_size );

    if ( $featured_image_link ) {
    $post_thumbnail = ‘‘ . $post_thumbnail . ‘‘;
    }
    ?>
    <div class=”tribe-event-image”>
    <?php
    // not escaped because it contains markup
    echo $post_thumbnail;
    ?>
    </div>
    <?php

    /**
    * Fire an action after the list widget featured image
    */
    do_action( ‘tribe_events_list_widget_after_the_event_image’ );
    }
    ?>

    #1573053
    Cliff
    Member

    You can delete all that except for the last opening PHP tag that includes the “do_action” part.

    Do make sure to do your modifications via our Themer’s Guide (in your child theme).

    #1573308
    ftww
    Participant

    This reply is private.

    #1573525
    Cliff
    Member

    Thanks for the update.

    Referring back to my initial reply in this thread:

    …you’ll need to follow along our Themer’s Guide to override one of these 2 files:

    • /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/list-widget.php

    • /wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php

    If overriding The Events Calendar’s didn’t work, please start over with the Events Calendar PRO override instead.

    Please let me know how this goes for you.

    #1574454
    ftww
    Participant

    Hi Cliff,
    Referring back to my previous thread as I mentioned above, I had placed the file directly in the tribe-events folder in my child theme and not the tribe-events/widgets. I saw then that the instruction at comments on top of file specified this so I rectified my mistake.

    However, upon uploading – this then broke the site from most functionality.

    By the way – there are no reference to images in your tribe events pro list-widget file.

    So – I tried just deleting the following section instead of all the code you said would be ok to remove:
    <div class=”tribe-event-image”>
    <?php
    // not escaped because it contains markup
    echo $post_thumbnail;
    ?>
    </div>

    This worked to remove the image, but it also removed the styling applied to featured events.

    Can you advise how I just remove the image and not affect any other functionality please.

    #1575085
    Cliff
    Member

    Sorry for the runaround. I did the testing myself and came up with this solution:

    Please let me know how this goes for you.

    #1576216
    ftww
    Participant

    Thanks Cliff. This Method has worked perfectly

    #1576593
    Cliff
    Member

    Glad to hear! Thanks for letting us know.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Hide Featured Image from Featured Events Widget’ is closed to new replies.