<?php /** * Team post media template * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } if (has_post_thumbnail()) { $thumb_id = get_post_thumbnail_id(); $teammate_thumb_args = array('img_meta' => wp_get_attachment_image_src($thumb_id, 'full'), 'img_id' => $thumb_id, 'options' => presscore_set_image_dimesions(), 'echo' => true, 'wrap' => '<img %IMG_CLASS% %SRC% %SIZE% %IMG_TITLE% %ALT% />'); $config = Presscore_Config::get_instance(); if ('post' == $config->get('post.open_as')) { $teammate_thumb_args['wrap'] = '<a %HREF% %CLASS%>' . $teammate_thumb_args['wrap'] . '</a>'; $teammate_thumb_args['class'] = 'rollover'; $teammate_thumb_args['href'] = get_permalink(); } else { $teammate_thumb_args['wrap'] = '<span>' . $teammate_thumb_args['wrap'] . '</span>'; } $teammate_thumb_args = presscore_add_thumbnail_class_for_masonry($teammate_thumb_args); echo '<div class="team-media">'; dt_get_thumb_img($teammate_thumb_args); echo '</div>'; }
/** * @param int $thumb_id * @param string $class * @return string */ function presscore_mod_albums_get_photo_img($thumb_id, $class = '') { $thumb_meta = wp_get_attachment_image_src($thumb_id, 'full'); $thumb_title = presscore_image_title_enabled($thumb_id) ? get_the_title() : ''; $thumb_args = array('echo' => false, 'img_meta' => $thumb_meta, 'img_id' => $thumb_id, 'img_class' => 'preload-me', 'class' => $class . ' dt-mfp-item', 'img_description' => get_the_content(), 'title' => $thumb_title, 'options' => presscore_set_image_dimesions(), 'wrap' => '<a %HREF% %CLASS% %TITLE% data-dt-img-description="%RAW_IMG_DESCRIPTION%" %CUSTOM%><img %IMG_CLASS% %SRC% %ALT% %SIZE% /></a>'); $video_url = presscore_get_image_video_url($thumb_id); if ($video_url) { $thumb_args['class'] .= ' mfp-iframe'; $thumb_args['href'] = $video_url; } else { $thumb_args['class'] .= ' mfp-image'; } // set proportion $thumb_args = presscore_add_thumbnail_class_for_masonry($thumb_args); return dt_get_thumb_img($thumb_args); }
<?php /** * Blog post media template for image post format in masonry layout * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } $thumb_id = get_post_thumbnail_id(); $thumb_args = array('img_meta' => wp_get_attachment_image_src($thumb_id, 'full'), 'img_id' => $thumb_id, 'options' => presscore_set_image_dimesions(), 'class' => 'alignnone rollover dt-single-mfp-popup dt-mfp-item mfp-image', 'wrap' => '<p><a %HREF% %CLASS% %CUSTOM% title="%RAW_ALT%" data-dt-img-description="%RAW_TITLE%"><img %IMG_CLASS% %SRC% %IMG_TITLE% %ALT% %SIZE% /></a></p>'); $thumb_args = apply_filters('dt_post_thumbnail_args', $thumb_args); // output media dt_get_thumb_img($thumb_args);
$media_items = array_map('trim', explode(',', $gallery['ids'])); } else { $media_items = array(); } // if we have post thumbnail and it's not hidden if (has_post_thumbnail() && !get_post_meta($post->ID, '_dt_post_options_hide_thumbnail', true)) { array_unshift($media_items, get_post_thumbnail_id()); } $attachments_data = presscore_get_attachment_post_data($media_items); $style = ' style="width: 100%;"'; $class = array('alignnone'); $config = presscore_get_config(); switch ($config->get('post.preview.gallery.style')) { case 'slideshow': $class[] = 'slider-simple'; if ('masonry' == $config->get('layout')) { $class[] = 'slider-masonry'; } echo presscore_get_post_media_slider($attachments_data, array('class' => $class, 'style' => $style, 'proportions' => $config->get('post.preview.gallery.sideshow.proportions'))); break; case 'hovered_gallery': $class[] = 'rollover'; $gallery_args = array('class' => $class, 'style' => $style, 'title_img_options' => presscore_set_image_dimesions()); echo presscore_get_images_gallery_hoovered($attachments_data, $gallery_args); break; default: if ('normal' == $config->get('post.preview.width')) { $class[] = 'format-gallery-normal'; } echo presscore_get_images_gallery_1($attachments_data, array('class' => $class, 'style' => $style)); }
*/ // File Security Check if (!defined('ABSPATH')) { exit; } ?> <div class="project-list-media"> <div class="buttons-on-img"> <?php $thumb_id = get_the_ID(); $thumb_meta = wp_get_attachment_image_src($thumb_id, 'full'); $video_url = esc_url(get_post_meta($thumb_id, 'dt-video-url', true)); $thumb_title = presscore_image_title_enabled($thumb_id) ? get_the_title() : ''; $thumb_args = array('img_meta' => $thumb_meta, 'img_id' => $thumb_id, 'img_class' => 'preload-me', 'class' => 'alignnone dt-mfp-item', 'options' => presscore_set_image_dimesions(), 'img_description' => get_the_content(), 'title' => $thumb_title, 'wrap' => '<a %HREF% %CLASS% %TITLE% data-dt-img-description="%RAW_IMG_DESCRIPTION%" %CUSTOM%><img %IMG_CLASS% %SRC% %ALT% %SIZE% /></a>'); if ($video_url) { $thumb_args['class'] .= ' rollover rollover-video mfp-iframe'; $thumb_args['href'] = $video_url; } else { $thumb_args['class'] .= ' rollover rollover-zoom mfp-image'; } // set proportion $thumb_args = presscore_add_thumbnail_class_for_masonry($thumb_args); dt_get_thumb_img($thumb_args); ?> </div> </div>
if (!$media_items) { $media_items = array(); } // add thumbnail to attachments list if (has_post_thumbnail()) { array_unshift($media_items, get_post_thumbnail_id()); } // if pass protected - show only cover image if ($media_items && post_password_required()) { $media_items = array($media_items[0]); } $exclude_cover = !$config->get('post.media.featured_image.enabled') && has_post_thumbnail(); // get attachments data $attachments_data = presscore_get_attachment_post_data($media_items); // if there are one image in gallery if (count($attachments_data) == 1) { $exclude_cover = false; } $class = array('rollover-click-target'); if (!$config->get('show_excerpts') && !$config->get('show_titles') && !$config->get('post.preview.mini_images.enabled')) { $class[] = 'rollover'; if ('lightbox' == $config->get('post.open_as')) { $class[] = 'rollover-zoom'; } } $gallery_args = array('class' => $class, 'exclude_cover' => $exclude_cover, 'show_preview_on_hover' => $config->get('post.preview.mini_images.enabled'), 'share_buttons' => true, 'attachments_count' => false, 'video_icon' => false, 'show_preview_on_hover' => false, 'title_img_options' => presscore_set_image_dimesions()); // open album post instead lightbox gallery if ('post' == $config->get('post.open_as')) { $gallery_args['title_image_args'] = array('href' => get_permalink(), 'class' => implode(' ', $class) . ' go-to'); } echo presscore_get_images_gallery_hoovered($attachments_data, $gallery_args);
<?php /** * Blog post media template for video post format in masonry layout * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } // thumbnail meta $thumb_id = get_post_thumbnail_id(); $video_url = esc_url(get_post_meta($thumb_id, 'dt-video-url', true)); $thumb_args = array('img_meta' => wp_get_attachment_image_src($thumb_id, 'full'), 'img_id' => $thumb_id, 'href' => $video_url, 'wrap' => '<p><a %HREF% %CLASS% %CUSTOM% title="%RAW_ALT%" data-dt-img-description="%RAW_TITLE%"><img %IMG_CLASS% %SRC% %ALT% %IMG_TITLE% %SIZE% /></a></p>', 'options' => presscore_set_image_dimesions()); // video with play button on hover $post_preview_style = presscore_get_config()->get('post.preview.video.style'); if (!$video_url) { $thumb_args['href'] = get_permalink(); $thumb_args['class'] = 'alignnone rollover'; } else { if ('image' == $post_preview_style) { $thumb_args['class'] = 'alignnone rollover dt-single-mfp-popup dt-mfp-item mfp-iframe'; } else { if ('image_play' == $post_preview_style) { $thumb_args['class'] = 'video-icon dt-single-mfp-popup dt-mfp-item mfp-iframe'; $thumb_args['wrap'] = '<div class="alignnone rollover-video"><img %IMG_CLASS% %SRC% %ALT% %IMG_TITLE% %SIZE% /><a %HREF% %CLASS% title="%RAW_ALT%" data-dt-img-description="%RAW_TITLE%"></a></div>'; } } }
<?php if (has_post_thumbnail()) { $thumb_id = get_post_thumbnail_id(); $thumb_meta = wp_get_attachment_image_src($thumb_id, 'full'); $video_url = esc_url(get_post_meta($thumb_id, 'dt-video-url', true)); } else { $thumb_id = 0; $thumb_meta = presscore_get_default_image(); $video_url = false; } if (!$video_url) { $link_classes = ' rollover'; } else { $link_classes = ' rollover-video'; } $thumb_args = array('img_meta' => $thumb_meta, 'img_id' => $thumb_id, 'img_class' => 'preload-me', 'class' => 'alignnone' . $link_classes, 'href' => get_permalink(), 'options' => presscore_set_image_dimesions(), 'wrap' => '<a %HREF% %CLASS% %TITLE% %CUSTOM%><img %IMG_CLASS% %SRC% %ALT% %SIZE% /></a>'); $thumb_args = apply_filters('dt_portfolio_thumbnail_args', $thumb_args); dt_get_thumb_img($thumb_args); // get image rollover icons $rollover_icons = ''; $rollover_icons .= presscore_get_project_rollover_link_icon(); $rollover_icons .= presscore_get_project_rollover_zoom_icon(array('popup' => 'single', 'class' => '', 'attachment_id' => $thumb_id)); $rollover_icons .= presscore_get_project_rollover_details_icon(); // output rollover if ($rollover_icons) { ?> <div class="rollover-content"> <div class="wf-table"> <div class="links-container wf-td ">
<?php /** * Blog post media template for masonry layout * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } $thumb_id = get_post_thumbnail_id(); $thumb_args = array('img_meta' => wp_get_attachment_image_src($thumb_id, 'full'), 'img_id' => $thumb_id, 'options' => presscore_set_image_dimesions(), 'class' => 'alignnone rollover', 'href' => get_permalink(), 'wrap' => '<p><a %HREF% %CLASS% %CUSTOM%><img %IMG_CLASS% %SRC% %ALT% %IMG_TITLE% %SIZE% /></a></p>'); $thumb_args = apply_filters('dt_post_thumbnail_args', $thumb_args); // output media dt_get_thumb_img($thumb_args);
/** * @param int $thumb_id * @param string $class * @return string */ function presscore_project_get_thumbnail_img($thumb_id, $class = '') { $thumb_args = array('echo' => false, 'img_meta' => wp_get_attachment_image_src($thumb_id, 'full'), 'img_id' => $thumb_id, 'img_class' => 'preload-me', 'class' => $class, 'href' => get_permalink(), 'options' => presscore_set_image_dimesions(), 'wrap' => '<a %HREF% %CLASS% %TITLE% %CUSTOM%><img %IMG_CLASS% %SRC% %ALT% %SIZE% /></a>'); $thumb_args = apply_filters('dt_portfolio_thumbnail_args', $thumb_args); return dt_get_thumb_img($thumb_args); }