Viewing 4 replies - 1 through 4 (of 4 total)
  • Sorry, at the moment that’s not supported, you’d need to make the edits manually in the Media Library.

    You could create a custom image size…

    add_image_size('my_custom_size', 200, 300, true);

    …and then modify the placeholder. This is where I’m a little unclear, though. Could someone explain more specifically than this how to modify the #_EVENTIMAGE{} placeholder to accept my_custom_size as an argument, instead of the dimensions?

    I figured it out (sort of—it’s not very flexible, but it works for a very specific thumb name).

    In your functions.php file, create your custom thumbnail size, as mentioned above. (You can use the Regenerate Thumbnails plugin to create new thumbnails of everything you already have in your Media Library.) Then add a function like this to your functions.php file:

    function my_em_placeholder_mod($replace, $EM_Event, $result){
    	if ($result == '#_EVENTIMAGE{my_custom_size}') {
    		$replace = get_the_post_thumbnail($EM_Event->post_id, 'my_custom_size');
    	}
    	return $replace;
    }

    Make sure it is called by adding a filter:

    add_filter('em_event_output_placeholder', 'my_em_placeholder_mod',1,3);

    Now, wherever you call #_EVENTIMAGE{my_custom_size} you should see the resized image. I hope this helps.

    Great solution, guys. I’ll bookmark this and link to it if anyone else asks the same question.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Crop thumbnail to exact dimensions’ is closed to new replies.