Пример #1
0
 public function widget($args, $instance)
 {
     extract($args);
     $title = $instance['title'];
     echo $before_widget;
     if (!empty($title)) {
         echo '<h3 class="widget-title">' . $title . '</h3>';
     }
     echo class_exists('MultiPostThumbnails') ? MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'flyer') : get_the_post_thumbnail();
     echo $after_widget;
 }
Пример #2
0
    function nectar_gallery($postid)
    {
        if (class_exists('MultiPostThumbnails')) {
            ?>
		   
		  <div class="flex-gallery"> 
		  	  <ul class="slides">
			    <?php 
            if (has_post_thumbnail()) {
                echo '<li>' . get_the_post_thumbnail($postid, 'full', array('title' => '')) . '</li>';
            }
            ?>
			   
			    <?php 
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'second-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'third-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'third-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'fourth-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fourth-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'fifth-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fifth-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'sixth-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'sixth-slide') . '</li>';
            }
            ?>
		   	   
		   	   </ul>
		   </div><!--/gallery-->
		<?php 
        }
    }
Пример #3
0
function ceo_display_comic_thumbnail($thumbnail_size = 'thumbnail', $override_post = null, $size = array())
{
    global $post;
    $thumbnail = $output = '';
    $post_to_use = !empty($override_post) ? $override_post : $post;
    if (class_exists('MultiPostThumbnails') && $thumbnail_size == 'secondary-image' && is_null($override_post)) {
        $thumbnail = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image');
    } else {
        if (!empty($size)) {
            $thumbnail = get_the_post_thumbnail($post_to_use->ID, $size);
        } else {
            $thumbnail = get_the_post_thumbnail($post_to_use->ID, $thumbnail_size);
        }
    }
    if (has_post_thumbnail($post_to_use->ID)) {
        $output = '<a href="' . get_permalink($post_to_use->ID) . '" rel="bookmark" title="' . get_the_title() . '">' . $thumbnail . '</a>' . "\r\n";
    } else {
        //			$output = "No Thumbnail Found.";
    }
    return apply_filters('easel_display_comic_thumbnail', $output);
}
Пример #4
0
function oxide_column_content($column)
{
    global $post;
    if ('thumbnail' == $column) {
        if (has_post_thumbnail()) {
            echo '<div>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</div>';
        } else {
            echo '<span style="color:#ff3333">Not Set!</span>';
        }
    } elseif ('status' == $column) {
        $terms = get_the_term_names($post->ID, 'status', '', ', ', '');
        if ($terms) {
            echo $terms;
        } else {
            echo '&nbsp;';
        }
    } elseif ('scat' == $column) {
        $terms = get_the_term_names($post->ID, 'student-category', '', ', ', '');
        if ($terms) {
            echo $terms;
        } else {
            echo '&nbsp;';
        }
    } elseif ('pcat' == $column) {
        $terms = get_the_term_names($post->ID, 'professional-category', '', ', ', '');
        if ($terms) {
            echo $terms;
        } else {
            echo '&nbsp;';
        }
    }
    if (class_exists('MultiPostThumbnails')) {
        if ('secondary' == $column) {
            if (MultiPostThumbnails::has_post_thumbnail($post->post_type, $post->post_type . '-secondary')) {
                echo '<div>' . MultiPostThumbnails::get_the_post_thumbnail($post->post_type, $post->post_type . '-secondary', $post->ID, 'thumbnail') . '</div>';
            } else {
                echo '<span style="color:#ff3333">Not Set!</span>';
            }
        }
    }
}
                <section class='comparison-table'>
                    <!-- Rating -->
                    <div class="span-comp-order">
                        <span class='comp-order'><?php 
    echo $comp_order;
    ?>
</span>
                    </div><!-- end span1 -->

                    <!-- Logo -->
                    <div class="span-aff-logo">
                        <?php 
    $attr['alt'] = $affiliate_name . ' Reviews';
    $attr['title'] = 'Visit ' . $affiliate_name;
    $attr['width'] = '150px';
    $affiliate_logo = MultiPostThumbnails::get_the_post_thumbnail('tdr_product', 'affiliate-logo', NULL, 'post-thumbnail', $attr);
    ?>
                        <a href='#' id="affiliate-logo"><?php 
    echo $affiliate_logo;
    ?>
</a>
                        <a href='#' class="btn btn-warning" id="visit-site-button"><i class="icon-play icon-white"></i> Visit Site</a>
                    </div><!-- end .aff-logo -->

                    <!-- Review -->
                    <div class="span7" id="review">
                        <div class="excerpt">
                            <strong>Our Take: </strong><?php 
    the_excerpt();
    ?>
                        </div><!-- end .excerpt -->
Пример #6
0
        if ($alt) {
            echo str_replace('"', "", $alt);
        } else {
            echo the_title();
        }
        ?>
" title="<?php 
        echo $caption;
        ?>
" class="scale-with-grid" onload="jQuery(this).closest('.featuredinner').animate({opacity : 1}, 500, function(){ jQuery(this).css('background', 'none')});" data-thumb="<?php 
        echo $thumb[0];
        ?>
"/>
                                   
                                   <?php 
        if (MultiPostThumbnails::get_the_post_thumbnail('post', 'second-slide', NULL, 'portfoliolarge') != '' && $homeslideshow == 'false') {
            ?>
                                    <?php 
            $tcounter = 2;
            while ($tcounter < $thumbnum) {
                if (${'thumb' . $tcounter}) {
                    ?>
                                                <img src="<?php 
                    echo ${'thumb' . $tcounter}[0];
                    ?>
" alt="<?php 
                    if (${'alt' . $tcounter}) {
                        echo str_replace('"', "", ${'alt' . $tcounter});
                    }
                    ?>
" class="scale-with-grid" data-thumb="<?php 
Пример #7
0
 function widget($args, $instance)
 {
     global $post, $wp_query;
     extract($args, EXTR_SKIP);
     ceo_protect();
     $current_permalink = '';
     if (!is_404()) {
         $current_permalink = get_permalink($post->ID);
     }
     $current_post_id = '';
     $chaptinfo = '';
     $dateset = '';
     if ($instance['inhistory']) {
         $day = get_the_date('d');
         $month = get_the_date('m');
         $dateset = '&month=' . $month . '&day=' . $day;
         $instance['random'] = true;
         /* set random to true even if false */
     }
     if ($instance['thumbchapt'] !== 'All') {
         $chaptinfo = '&chapters=' . $instance['thumbchapt'];
     }
     if ($instance['first']) {
         $order = 'ASC';
     } else {
         $order = 'DESC';
     }
     $comic_query = 'showposts=' . $instance['thumbcount'] . '&order=' . $order . '&post_type=comic' . $chaptinfo . $dateset;
     if ($instance['random']) {
         $comic_query .= '&orderby=rand';
     }
     if (!empty($post) && $instance['random']) {
         $current_post_id = $post->ID;
         $comic_query .= '&exclude=' . $current_post_id;
     }
     $thumbnail_size = isset($instance['thumbnail_size']) ? $instance['thumbnail_size'] : 'thumbnail';
     $thumbnail_query = new WP_Query($comic_query);
     $archive_image = null;
     if ($thumbnail_query->have_posts()) {
         echo $before_widget;
         $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
         if (!empty($title)) {
             echo $before_title . $title . $after_title;
         }
         while ($thumbnail_query->have_posts()) {
             $thumbnail_query->the_post();
             $the_permalink = get_permalink($post->ID);
             if (!isset($instance['same'])) {
                 $instance['same'] = false;
             }
             if (!($instance['same'] && $the_permalink == $current_permalink)) {
                 echo '<div class="comic-thumb-wrap comic-thumb-' . $post->ID . '">';
                 if ($instance['centering']) {
                     echo "\r\n<center>\r\n";
                 }
                 if (isset($instance['secondary']) && $instance['secondary'] && class_exists('MultiPostThumbnails')) {
                     $secondary_image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image', $post->ID, 'secondary-image');
                     if (!empty($secondary_image)) {
                         echo "<a href=\"" . $the_permalink . "\" rel=\"bookmark\" title=\"Permanent Link to " . get_the_title() . "\">" . $secondary_image . "</a>\r\n";
                     } else {
                         if (has_post_thumbnail($post->ID)) {
                             echo "<a href=\"" . $the_permalink . "\" rel=\"bookmark\" title=\"Permanent Link to " . get_the_title() . "\">" . get_the_post_thumbnail($post->ID, $thumbnail_size) . "</a>\r\n";
                         } else {
                             echo "No Thumbnail Found.";
                         }
                     }
                 } else {
                     if (has_post_thumbnail($post->ID)) {
                         echo "<a href=\"" . $the_permalink . "\" rel=\"bookmark\" title=\"Permanent Link to " . get_the_title() . "\">" . get_the_post_thumbnail($post->ID, $thumbnail_size) . "</a>\r\n";
                     } else {
                         echo "No Thumbnail Found.";
                     }
                 }
                 if ($instance['linktitle']) {
                     echo '<div class="comic-thumb-title"><a href="' . $the_permalink . '" rel="bookmark" title="Permanent Link to ' . get_the_title() . '">' . get_the_title() . '</a></div><div class="clear"></div>';
                 }
                 if ($instance['centering']) {
                     echo "\r\n</center>\r\n";
                 }
                 echo "</div>\r\n";
             }
         }
         echo $after_widget;
     }
     ceo_unprotect();
 }
?>
</a>

			<strong class="item-price"><span><?php 
printf(__('Item Price: %s', 'marketify'), edd_price(get_the_ID(), false));
?>
</span></strong>

			<?php 
do_action('marketify_download_content_image_overlay_after');
?>
		</div>
	</div>

	<?php 
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::get_the_post_thumbnail('download', 'grid-image')) {
    ?>
		<?php 
    MultiPostThumbnails::the_post_thumbnail('download', 'grid-image', null, 'content-grid-download');
    ?>
	<?php 
} elseif (has_post_thumbnail()) {
    ?>
		<?php 
    the_post_thumbnail('content-grid-download');
    ?>
	<?php 
} else {
    ?>
		<span class="image-placeholder"></span>
	<?php 
Пример #9
0
            $popup = get_option('of_slideshow_popup');
            // Get number of slides or set the default
            if ($thumbnum = of_get_option('of_thumbnail_number')) {
                $thumbnum = $thumbnum + 1;
            } else {
                $thumbnum = 7;
            }
            if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
                // if the post has a WP 2.9+ Thumbnail
                get_post_info($slide_crop, $post->ID, $slide_crop, $thumbnum);
                ?>
          
          <div class="featuredimage">     
              <div class="slider-wrapper theme-default">
                <div <?php 
                if (MultiPostThumbnails::get_the_post_thumbnail('post', 'second-slide', NULL, 'portfoliolarge') != '') {
                    echo $auto_play == 'No' || $auto_play == 'no' ? 'class="slider nivoSlider"' : 'class="sliderautoplay nivoSlider"';
                }
                ?>
 >
    
                <?php 
                if ($popup == 'On') {
                    ?>
<a href="<?php 
                    echo $full[0];
                    ?>
" rel="prettyPhoto[pp_gal]" title="<?php 
                    if ($alt) {
                        echo str_replace('"', "", $alt);
                    } else {
Пример #10
0
 function widget($args, $instance)
 {
     global $post, $wp_query;
     extract($args, EXTR_SKIP);
     ceo_protect();
     $current_permalink = '';
     if (!is_404() && !empty($post)) {
         $current_permalink = get_permalink($post->ID);
     }
     $current_post_id = '';
     $chaptinfo = '';
     $dateset = '';
     if (!isset($instance['showdate'])) {
         $instance['showdate'] = false;
     }
     if (!empty($post)) {
         $current_post_id = $post->ID;
     }
     $comic_query = array('post_type' => 'comic', 'showposts' => $instance['thumbcount'], 'month' => $instance['inhistory'] ? get_the_date('m') : '', 'day' => $instance['inhistory'] ? get_the_date('d') : '', 'chapters' => $instance['thumbchapt'] && $instance['thumbchapt'] !== 'All' ? $instance['thumbchapt'] : '', 'order' => $instance['first'] ? 'ASC' : 'DESC', 'orderby' => $instance['inhistory'] || $instance['random'] ? 'rand' : '', 'exclude' => ($instance['inhistory'] || $instance['random']) && $instance['same'] ? $current_post_id : '');
     $thumbnail_size = isset($instance['thumbnail_size']) ? $instance['thumbnail_size'] : 'thumbnail';
     //		var_dump($comic_query);
     $thumbnail_query = new WP_Query($comic_query);
     $archive_image = null;
     if ($thumbnail_query->have_posts()) {
         echo $before_widget;
         $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
         if (!empty($title)) {
             echo $before_title . $title . $after_title;
         }
         while ($thumbnail_query->have_posts()) {
             $thumbnail_query->the_post();
             $the_permalink = get_permalink($post->ID);
             if (!isset($instance['same'])) {
                 $instance['same'] = false;
             }
             if (!($instance['same'] && $the_permalink == $current_permalink)) {
                 echo '<div class="comic-thumb-wrap comic-thumb-' . $post->ID . '">';
                 if ($instance['centering']) {
                     echo "\r\n<center>\r\n";
                 }
                 if (isset($instance['secondary']) && $instance['secondary'] && class_exists('MultiPostThumbnails')) {
                     $secondary_image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image', $post->ID, 'secondary-image');
                     if (!empty($secondary_image)) {
                         echo '<a href="' . $the_permalink . '" rel="bookmark" title="' . __('Permanent Link to', 'comiceasel') . ' ' . get_the_title() . '">' . $secondary_image . '</a>' . "\r\n";
                     } else {
                         if (has_post_thumbnail($post->ID)) {
                             echo '<a href="' . $the_permalink . '" rel="bookmark" title="' . __('Permanent Link to', 'comiceasel') . ' ' . get_the_title() . '">' . get_the_post_thumbnail($post->ID, $thumbnail_size) . '</a>' . "\r\n";
                         } else {
                             echo __('No Thumbnail Found.', 'comiceasel');
                         }
                     }
                 } else {
                     if (has_post_thumbnail($post->ID)) {
                         echo '<a href="' . $the_permalink . '" rel="bookmark" title="' . __('Permanent Link to', 'comiceasel') . ' ' . get_the_title() . '">' . get_the_post_thumbnail($post->ID, $thumbnail_size) . '</a>' . "\r\n";
                     } else {
                         echo __('No Thumbnail Found.', 'comiceasel');
                     }
                 }
                 if ($instance['linktitle']) {
                     echo '<div class="comic-thumb-title"><a href="' . $the_permalink . '" rel="bookmark" title="' . __('Permanent Link to', 'comiceasel') . ' ' . get_the_title() . '">' . get_the_title() . '</a></div><div class="clear"></div>';
                 }
                 if ($instance['showdate']) {
                     echo '<div class="comic-thumb-date">' . get_the_date(get_option('date_format')) . '</div>';
                 }
                 if ($instance['centering']) {
                     echo "\r\n</center>\r\n";
                 }
                 echo "</div>\r\n";
             }
         }
         echo $after_widget;
     }
     ceo_unprotect();
 }
function tdr_top_choices_table($args)
{
    $defaults = array('number_to_show' => 3, 'number_to_query' => 3, 'offer_cat_terms' => get_terms('offer-category', array('fields' => 'ids')), 'rank_meta_key' => '');
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    /* Set up the Query */
    /* Taxonomy for the Query
     * ***************************************************************/
    // Set up the taxonomy
    $offer_cat_args = array(array('taxonomy' => 'offer-category', 'field' => 'id', 'terms' => $offer_cat_terms));
    /* Create the query 
     * ***************************************************************/
    $basic_query = new WP_Query(array('tax_query' => $offer_cat_args, 'post_type' => 'tdr_product', 'posts_per_page' => (int) $number_to_query, 'order' => 'ASC', 'orderby' => 'meta_value_num', 'meta_key' => 'thunder_plugin_products_rank'));
    // If a Rank Key is defined, reorder the Products
    if (!empty($rank_meta_key)) {
        global $tdr_rank_key;
        $tdr_rank_key = $rank_meta_key;
        usort(&$basic_query->{'posts'}, 'tdr_sort_by_offer_category_rank');
        $basic_query->rewind_posts();
    }
    // Update to only show the $number_to_show
    $basic_query->post_count = $number_to_show;
    $returner = '<div class="row">';
    $returner .= '<div class="span">';
    // Set up tdr_product
    $product = new Thunder_Plugin_Products();
    while ($basic_query->have_posts()) {
        $basic_query->the_post();
        // Get the ID for the Rating Bar, this determines how the stars appear
        $internal_rating = floatval($product->get_the_internal_rating());
        if ($internal_rating < 2.2) {
            $internal_rating_id = 'two_zero';
        } elseif ($internal_rating < 2.7) {
            $internal_rating_id = 'two_five';
        } elseif ($internal_rating < 3.2) {
            $internal_rating_id = 'three_zero';
        } elseif ($internal_rating < 3.7) {
            $internal_rating_id = 'three_five';
        } elseif ($internal_rating < 4.2) {
            $internal_rating_id = 'four_zero';
        } elseif ($internal_rating < 4.7) {
            $internal_rating_id = 'four_five';
        } elseif ($internal_rating >= 4.7) {
            $internal_rating_id = 'five_zero';
        } else {
            $internal_rating_id = $internal_rating;
        }
        // Force display of non-significant digits for the internal rating
        $internal_rating = sprintf("%1.1f", $internal_rating);
        // Output a row for this Product, and get its name
        $returner .= '<div class="row"><div class="span4" style="border-top: 1px solid #eee; padding: 10px 0;">';
        $product_name = $product->get_the_affiliate_name();
        // Get the logo, and set up link
        add_image_size('our_top_choices_thumb', 120, 30);
        $review_link = get_permalink();
        $attr['alt'] = $product_name . ' Reviews';
        $attr['title'] = $product_name . ' Reviews';
        if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail('tdr_product', 'thumbnail-affiliate-logo')) {
            $affiliate_img = MultiPostThumbnails::get_the_post_thumbnail('tdr_product', 'thumbnail-affiliate-logo', NULL, 'our_top_choices_thumb', $attr);
        }
        $returner .= "<div class='our_top_logos'>";
        $returner .= "<a href='{$review_link}'>";
        $returner .= $affiliate_img;
        $returner .= '</a>';
        $returner .= "</div><!-- end .our_top_logos -->";
        $returner .= "<div class='our_top_ratings' style=''>";
        $returner .= "<div id='{$internal_rating_id}' class='rating-bar' style='position: relative; left: 5px;'></div>";
        $returner .= "<span style='font-size: 24px; font-weight: bold; line-height: 24px; '>{$internal_rating}</span>" . " <span class='review-link'>(<a href='{$review_link}' style=''>Review</a>)</span>";
        $returner .= "</div>";
        $returner .= "<div class='our_top_visit' style=''>";
        $product_id = $product->get_the_id();
        $jump_page_url = get_home_url() . "/visit?site={$product_id}&t=sidebar";
        $returner .= "<a target=_blank' href='{$jump_page_url}'><span style='font-size:10px;'>&#9654;</span> Visit Site</a>";
        $returner .= "</div>";
        $returner .= '</div><!-- end .span --></div><!-- end .row -->';
    }
    $returner .= "</div><!-- end .span -->";
    $returner .= "</div><!-- end .row -->";
    $returner .= '<div class="read_more_articles">';
    $offer_category_permalink = get_home_url() . '/reviews';
    $returner .= "<a href='{$offer_category_permalink}' id='review_page_link'>+ View All Reviews</a>";
    $returner .= '</div><!-- end .read_more_articles -->';
    return $returner;
}
function bliccaThemes_gallery($id)
{
    $gallery_style = get_post_meta(get_the_ID(), 'gallery_format_style', true);
    $gallery_class = $thumbsizer = "";
    if ($gallery_style == "grid") {
        $gallery_class = "post-grid-thumbnails";
        $thumbsizer = "bliccaThemes-grid";
    } else {
        $gallery_class = "post-slider";
        $thumbsizer = "post-thumbnails";
    }
    if (class_exists('MultiPostThumbnails')) {
        ?>
    <div class="<?php 
        echo esc_attr($gallery_class);
        ?>
">
    <ul class="slides">
        <?php 
        if (has_post_thumbnail()) {
            $post_thumbnail_id = get_post_thumbnail_id(get_the_ID());
            $thumb_post = get_post($post_thumbnail_id);
            // ESC
            //
            $src_url = esc_url($thumb_post->guid);
            $caption = trim(strip_tags($thumb_post->post_excerpt));
            if (!empty($caption)) {
                $caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
            } else {
                $caption = "";
            }
            echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . get_the_post_thumbnail($id, $thumbsizer) . '</a>' . $caption . '</li>';
        }
        ?>
                <?php 
        if (class_exists('MultiPostThumbnails')) {
            $image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image', NULL, $thumbsizer);
        }
        if (!empty($image)) {
            $post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'secondary-image', get_the_ID());
            $thumb_post = get_post($post_thumbnail_id);
            $src_url = esc_url($thumb_post->guid);
            $caption = trim(strip_tags($thumb_post->post_excerpt));
            if (!empty($caption)) {
                $caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
            } else {
                $caption = "";
            }
            echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
        }
        if (class_exists('MultiPostThumbnails')) {
            $image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'third-image', NULL, $thumbsizer);
        }
        if (!empty($image)) {
            $post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'third-image', get_the_ID());
            $thumb_post = get_post($post_thumbnail_id);
            $src_url = esc_url($thumb_post->guid);
            $caption = trim(strip_tags($thumb_post->post_excerpt));
            if (!empty($caption)) {
                $caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
            } else {
                $caption = "";
            }
            echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
        }
        if (class_exists('MultiPostThumbnails')) {
            $image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fourth-image', NULL, $thumbsizer);
        }
        if (!empty($image)) {
            $post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'fourth-image', get_the_ID());
            $thumb_post = get_post($post_thumbnail_id);
            $src_url = esc_url($thumb_post->guid);
            $caption = trim(strip_tags($thumb_post->post_excerpt));
            if (!empty($caption)) {
                $caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
            } else {
                $caption = "";
            }
            echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
        }
        if (class_exists('MultiPostThumbnails')) {
            $image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fifth-image', NULL, $thumbsizer);
        }
        if (!empty($image)) {
            $post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'fifth-image', get_the_ID());
            $thumb_post = get_post($post_thumbnail_id);
            $src_url = esc_url($thumb_post->guid);
            $caption = trim(strip_tags($thumb_post->post_excerpt));
            if (!empty($caption)) {
                $caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
            } else {
                $caption = "";
            }
            echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
        }
        if (class_exists('MultiPostThumbnails')) {
            $image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'last-image', NULL, $thumbsizer);
        }
        if (!empty($image)) {
            $post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'last-image', get_the_ID());
            $thumb_post = get_post($post_thumbnail_id);
            $src_url = esc_url($thumb_post->guid);
            $caption = trim(strip_tags($thumb_post->post_excerpt));
            if (!empty($caption)) {
                $caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
            } else {
                $caption = "";
            }
            echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
        }
        ?>
    </ul>
    </div><?php 
    }
}
Пример #13
0
/**
 * Shortcodes output posts
 */
function display_latest_post($atts)
{
    extract(shortcode_atts(array('numberofpost' => '1', 'categoryid' => ''), $atts));
    $output = '';
    $querystring = 'posts_per_page=' . $numberofpost;
    if (strlen($categoryid) > 0) {
        $querystring .= '&cat=' . $categoryid;
    }
    $query = new WP_Query($querystring);
    while ($query->have_posts()) {
        $query->the_post();
        $output .= '<article class="posts">';
        $output .= '<div class="image-wrap pull-left">';
        if (class_exists('MultiPostThumbnails')) {
            $output .= MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image', NULL, 'secondary-featured-thumbnail');
        }
        $output .= '<a class="mask" href="' . get_permalink() . '"></a>';
        $output .= '</div>';
        $output .= '<h3><a class="link" href="' . get_permalink() . '">' . get_the_title() . '</a></h3>';
        $output .= '<p class="date light-grey-text">' . get_the_time('F j, Y') . '</p>';
        $output .= '<p class="light-grey-text">' . get_the_excerpt();
        $output .= '<a href="' . get_permalink() . '" class="posts-arrow"></a>';
        $output .= '</p>';
        $output .= '</article>';
    }
    wp_reset_postdata();
    return $output;
}
Пример #14
0
 /**
  * Returns the small badge image size.
  *
  * When given a badge ID and badge dimension (square), returns
  * the badge image formatted in HTML.
  *
  * @param $badge_id, $badge_dimension
  * @return $badge_image_small
  */
 public function badge_thumb($badge_id, $badge_dimension)
 {
     // Locate the right small badge image
     if (class_exists('MultiPostThumbnails')) {
         $badge_image_small = MultiPostThumbnails::get_the_post_thumbnail('simplebadges_badge', 'simplebadges-smaller', $badge_id, array($badge_dimension, $badge_dimension));
     } else {
         $badge_image_small = get_the_post_thumbnail($badge_id, array($badge_dimension, $badge_dimension));
     }
     return $badge_image_small;
 }
Пример #15
0
/**
 *
 */
function marketify_get_attached_media_args($args, $type, $post)
{
    global $post;
    if ('image' != $type) {
        return $args;
    }
    if ('download' != $post->post_type) {
        return $args;
    }
    if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::get_the_post_thumbnail('download', 'grid-image')) {
        $args['exclude'] = MultiPostThumbnails::get_post_thumbnail_id('download', 'grid-image', $post->ID);
    }
    return $args;
}