Exemplo n.º 1
0
 function avia_image_slideshow_filter($current_post)
 {
     $prepend_image = get_the_post_thumbnail(get_the_ID(), 'large');
     $image = "";
     if (!$prepend_image) {
         $image = avia_regex($current_post['content'], 'image');
         if (is_array($image)) {
             $image = $image[0];
             $prepend_image = '<div class="avia-post-format-image"><img src="' . $image . '" alt="" title ="" /></div>';
         } else {
             $image = avia_regex($current_post['content'], '<img />', "");
             if (is_array($image)) {
                 $prepend_image = '<div class="avia-post-format-image">' . $image[0] . "</div>";
             }
         }
     } else {
         $prepend_image = '<div class="avia-post-format-image">' . $prepend_image . "</div>";
     }
     if (!empty($prepend_image) && is_string($prepend_image)) {
         if ($image) {
             $current_post['content'] = str_replace($image, "", $current_post['content']);
         }
         $current_post['before_content'] = $prepend_image;
         $current_post['slider'] = "";
     }
     return avia_default_title_filter($current_post);
 }
Exemplo n.º 2
0
 function filter_image($entry)
 {
     $prepend_image = get_the_post_thumbnail(get_the_ID(), 'large');
     $image = "";
     if (!$prepend_image) {
         $image = avia_regex($entry->post_content, 'image');
         if (is_array($image)) {
             $image = $image[0];
             $prepend_image = '<div class="avia-post-format-image"><img src="' . $image . '" alt="" title ="" /></div>';
         } else {
             $image = avia_regex($entry->post_content, '<img />', "");
             if (is_array($image)) {
                 $prepend_image = '<div class="avia-post-format-image">' . $image[0] . "</div>";
             }
         }
     } else {
         $large_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'extra_large');
         $prepend_image = '<div class="avia-post-format-image"><a href="' . $large_image[0] . '">' . $prepend_image . "</a></div>";
     }
     if (!empty($prepend_image) && is_string($prepend_image)) {
         if ($image) {
             $entry->av_modified_content = str_replace($image, "", $entry->post_content);
         }
         $entry->av_image = $prepend_image;
     }
 }
 function avia_image_slideshow_filter($current_post)
 {
     $prepend_image = get_the_post_thumbnail(get_the_ID(), 'large');
     $image = "";
     if (!$prepend_image) {
         $image = avia_regex($current_post['content'], 'image');
         if (is_array($image)) {
             $image = $image[0];
             $prepend_image = '<div class="avia-post-format-image"><img src="' . $image . '" alt="" title ="" /></div>';
         } else {
             $image = avia_regex($current_post['content'], '<img />', "");
             if (is_array($image)) {
                 $prepend_image = '<div class="avia-post-format-image">' . $image[0] . "</div>";
             }
         }
     } else {
         $large_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'extra_large');
         $prepend_image = '<div class="avia-post-format-image"><a href="' . $large_image[0] . '">' . $prepend_image . "</a></div>";
     }
     if (!empty($prepend_image) && is_string($prepend_image)) {
         if ($image) {
             $current_post['content'] = str_replace($image, "", $current_post['content']);
         }
         $current_post['before_content'] = $prepend_image;
         $current_post['slider'] = "";
     }
     if (is_single(get_the_ID()) && get_post_meta($current_post['the_id'], '_avia_hide_featured_image', true)) {
         $current_post['before_content'] = "";
     }
     return avia_default_title_filter($current_post);
 }