Home › Forums › Calendar Products › Events Calendar PRO › Hide Featured Image from Featured Events Widget
- This topic has 11 replies, 2 voices, and was last updated 7 years, 9 months ago by
ftww.
-
AuthorPosts
-
June 21, 2018 at 8:47 am #1558333
ftww
ParticipantHi 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
June 21, 2018 at 3:15 pm #1558751Cliff
MemberHi. 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
June 22, 2018 at 1:21 am #1558960ftww
ParticipantHi 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
June 22, 2018 at 1:30 pm #1559574Cliff
MemberCopy /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.
July 11, 2018 at 12:54 am #1572326ftww
ParticipantHi 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’ );
}
?>July 11, 2018 at 3:17 pm #1573053Cliff
MemberYou 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).
July 12, 2018 at 2:10 am #1573308ftww
ParticipantThis reply is private.
July 12, 2018 at 7:55 am #1573525Cliff
MemberThanks 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.
July 13, 2018 at 2:20 am #1574454ftww
ParticipantHi 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.
July 13, 2018 at 2:30 pm #1575085Cliff
MemberSorry for the runaround. I did the testing myself and came up with this solution:
- Remove the entire PHP “if featured event” section from /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/modules/single-event.php
- Screenshot: https://cl.ly/2N0E0O2E3g1h
- It will change from https://cl.ly/1B2t1r0T2Y2g to https://cl.ly/142n3V120N3z
Please let me know how this goes for you.
July 16, 2018 at 8:24 am #1576216ftww
ParticipantThanks Cliff. This Method has worked perfectly
July 16, 2018 at 2:40 pm #1576593Cliff
MemberGlad to hear! Thanks for letting us know.
-
AuthorPosts
- The topic ‘Hide Featured Image from Featured Events Widget’ is closed to new replies.
