?> <dt>Contact:</dt> <dd><?php the_field('event_contact'); ?> </dd> <?php } ?> </dl> <?php if (get_field('image')) { ?> <?php $image = new VernacularImage(get_field('image')); ?> <img src="<?php echo $image->crop(600, 400, false); ?> " /> <?php } ?> <div class="description user-content"> <?php the_field('description'); ?> </div> </section>
function the_resized_post_thumbnail_path($width = 500, $height = 300, $crop = true, $alt = null, $class = 'wp-post-image') { $upload_dir = wp_upload_dir(); $attachment = wp_get_attachment_metadata(get_post_thumbnail_id(), 'original'); if ($attachment) { $image_path = $upload_dir['baseurl'] . '/' . $attachment['file']; $image = new VernacularImage($image_path); $cropped_image = $image->crop($width, $height, $crop); echo $cropped_image; } }
if (count($events) > 0) { ?> <?php foreach ($events as $post) { _loop::load($post); ?> <section class="event" id="event_<?php the_ID(); ?> "> <?php the_event_date(); ?> <?php $image = new VernacularImage(get_field('image')); ?> <img src="<?php echo $image->crop(240, 282); ?> " /> <div class="info"> <h3> <a href="<?php the_permalink(); ?> "> <?php the_title(); ?>