Home › Forums › Calendar Products › Events Calendar PRO › unwanted large image on each event page
- This topic has 30 replies, 6 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
January 19, 2012 at 2:25 pm #13655
Jonah
ParticipantHi Giornale, no it will only affect your single events.
January 19, 2012 at 3:19 pm #13661giornale di
MemberBrilliant – ok sorted … thanks again Jonah … I do have one last question …
if you look at my front page – http://www.giornaledibarganews.com/right at the bottom there is the coming events widget which automatically puts in some text and an image …. I generally have quite a bit of text along with the event ….. most of which I don’t want on the front page. I have been using after the image to stop all that text. Is there a cleaner way of doing this ? Something in the code that will reduce the amount of text in the widget maybe ?
ciao
keaneJanuary 19, 2012 at 3:21 pm #13662giornale di
MemberStuff got removed from the last comment … it should have read : I have been using the — MORE link — after the image to stop all that text.
January 19, 2012 at 3:31 pm #13665giornale di
Memberthe same problem with the list of events at a venue :
http://www.giornaledibarganews.com/venue/teatro-dei-differenti-2/
I would like to restrict some of that text automatically … I can do this with –MORE— but as there will be a number of different people posting events of the calendar, it would be much cleaner if it could be done automatically
January 19, 2012 at 9:35 pm #13686Jonah
ParticipantHi Giornale, yeah essentially what you’ll want to do is override those widgets by copying the widget files located in wp-content/plugins/the-events-calendar/views or wp-content/plugins/events-calendar-pro/views (for PRO widgets) and place them in the ‘events’ folder in your theme. Then, instead of using the_content() to pull in the events text content you’ll want to use a custom function where you can automatically control the excerpt. I actually use a combination of functions but first copy the following code into your functions.php file: http://pastebin.com/PMf0vKQk
Then I execute a custom truncating command like so:
echo restoreTags(trunc(strip_tags(get_the_content(), ''),18));
You can optionally remove the strip_tags and restoreTags functions but I find them helpful to normalize my excerpts. If you just wanted to use the trunc function do this:
echo trunc(get_the_content(),18);
That should get you pointed in the right direction but let me know if you have any other questions.
January 19, 2012 at 9:36 pm #13687Jonah
ParticipantThe first line of code got filtered, here’s the full command: http://pastebin.com/LMn3sC7k
February 6, 2012 at 10:44 pm #14779nakturnal
ParticipantHey, sorry I posted something and then just disappeared. I’m glad they were able to help you out!
I recall when I looked at your link a while back the large image that was appearing was given a thumbnail class, hence the CSS suggestion. It looks like Tribe’s crew came up with a more efficient way though! Cheers!
February 7, 2012 at 12:19 pm #14803Rob
MemberThanks for the follow-up, Nakturnal. Weird that it disappeared but if that happens again let me know and I’ll dig deeper for the “ghost in the machine”, as it may be 🙂
February 18, 2012 at 11:58 am #15377Will
ParticipantI too would like to prevent the featured image from showing on the event itself. I’ve created the events folder in my theme and placed single.php in there but am unsure how to edit it? Can you guys point me in the right direction?
February 20, 2012 at 9:40 am #15400Jonah
ParticipantHey Will, do you have a code editor to open the PHP file? This is what you’ll need to do…
February 20, 2012 at 10:13 am #15404Will
ParticipantYup
February 20, 2012 at 3:42 pm #15415Will
ParticipantSorry, to be more precise, yes I do have a way to edit php files. What is it that I will need to do?
And thank you again for your support.February 21, 2012 at 10:16 am #15453Rob
MemberHey Will: just a heads up that I believe Jonah is out travelling today, so you may not get a response here until tonight at the earliest and possibly tomorrow. Wanted to make sure you’re aware.
February 21, 2012 at 1:58 pm #15471Jonah
ParticipantHey Will, just remove lines 93-96 in single.php to remove the featured image from your events.
February 22, 2012 at 7:47 pm #15518Will
ParticipantHAHAHAHA!!!!!!!!!!
-
AuthorPosts
- The topic ‘unwanted large image on each event page’ is closed to new replies.
