Example #1
0
<?php

if ($post_format_meta = helium_extract_post_format_meta()) {
    ?>
<section class="post-media post-media-gallery">

	<?php 
    if ('slider' === $post_format_meta['type']) {
        ?>

	<div class="royalSlider rsHelium" data-rs-settings="<?php 
        echo esc_attr(helium_rs_settings($post_format_meta));
        ?>
"><?php 
        foreach ($post_format_meta['images'] as $image) {
            $attachment = wp_get_attachment_image_src($image, 'full');
            echo wp_get_attachment_image($image, 'full', false, array('class' => 'attachment-full rsImg', 'data-rsw' => $attachment[1], 'data-rsh' => $attachment[2]));
        }
        ?>
</div>

	<?php 
    } elseif ('justified' === $post_format_meta['type']) {
        ?>

	<div class="justified-grids"><?php 
        foreach ($post_format_meta['images'] as $image) {
            echo wp_get_attachment_image($image, 'full');
        }
        ?>
</div>
Example #2
0
             // Check if the attachment is an audio
             if (0 === strpos(get_post_mime_type($media['audio_src']), 'audio/')) {
                 echo wp_audio_shortcode(array('src' => wp_get_attachment_url($media['audio_src'])));
             }
             break;
     }
 } else {
     $attachments = array();
     foreach ($media['images'] as $image) {
         if ($attachment = wp_get_attachment_image_src($image, 'full')) {
             $attachments[$image] = $attachment;
         }
     }
     switch ($media['type']) {
         case 'slider':
             echo '<div class="royalSlider rsHelium" data-rs-settings="' . esc_attr(helium_rs_settings($media)) . '">';
             foreach ($attachments as $id => $attachment) {
                 echo wp_get_attachment_image($id, 'full', false, array('class' => 'attachment-full rsImg', 'data-rsw' => $attachment[1], 'data-rsh' => $attachment[2]));
             }
             echo '</div>';
             break;
         case 'justified-grids':
             echo '<div class="justified-grids">';
             foreach ($attachments as $id => $attachment) {
                 echo wp_get_attachment_image($id, 'full');
             }
             echo '</div>';
             break;
         case 'stacked':
         default:
             foreach ($attachments as $id => $attachment) {