当前位置: 首页>>代码示例>>PHP>>正文


PHP kd_mfi_get_featured_image_id函数代码示例

本文整理汇总了PHP中kd_mfi_get_featured_image_id函数的典型用法代码示例。如果您正苦于以下问题:PHP kd_mfi_get_featured_image_id函数的具体用法?PHP kd_mfi_get_featured_image_id怎么用?PHP kd_mfi_get_featured_image_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了kd_mfi_get_featured_image_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render


//.........这里部分代码省略.........
                     $format_class = 'quotes-left';
                     break;
                 case 'video':
                     $format_class = 'film';
                     break;
                 case 'audio':
                     $format_class = 'headphones';
                     break;
                 case 'chat':
                     $format_class = 'bubbles';
                     break;
                 default:
                     $format_class = 'pen';
                     break;
             }
             $date_box = sprintf('<div %s><div %s><span %s>%s</span><span %s>%s</span></div><div %s><i %s></i></div></div>', FusionCore_Plugin::attributes('date-and-formats'), FusionCore_Plugin::attributes('date-box'), FusionCore_Plugin::attributes('date'), get_the_time('j'), FusionCore_Plugin::attributes('month-year'), get_the_time('m, Y'), FusionCore_Plugin::attributes('format-box'), FusionCore_Plugin::attributes('icon-' . $format_class));
         }
         if ($thumbnail == 'yes' && $layout != 'date-on-side') {
             if ($layout == 'default') {
                 $image_size = 'recent-posts';
             } elseif ($layout == 'thumbnails-on-side') {
                 $image_size = 'portfolio-two';
             }
             if ($smof_data['legacy_posts_slideshow']) {
                 $args = array('exclude' => get_post_thumbnail_id(), 'numberposts' => $smof_data['posts_slideshow_number'] - 1, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_mime_type' => 'image', 'post_parent' => get_the_ID(), 'post_status' => null, 'post_type' => 'attachment');
                 $attachments = get_posts($args);
                 if ($attachments || has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                     if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                         $slides .= sprintf('<li><div %s>%s</div></li>', FusionCore_Plugin::attributes('full-video'), get_post_meta(get_the_ID(), 'pyre_video', true));
                     }
                     if (has_post_thumbnail()) {
                         $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $image_size);
                         $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                         $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                         $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), FusionCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => get_the_title())));
                     }
                     if ($smof_data['posts_slideshow']) {
                         foreach ($attachments as $attachment) {
                             $attachment_image = wp_get_attachment_image_src($attachment->ID, $image_size);
                             $full_image = wp_get_attachment_image_src($attachment->ID, 'full');
                             $attachment_data = wp_get_attachment_metadata($attachment->ID);
                             $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), FusionCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => $attachment->post_title)));
                         }
                     }
                     $slideshow = sprintf('<div %s><ul %s>%s</ul></div>', FusionCore_Plugin::attributes('recentposts-shortcode-slideshow'), FusionCore_Plugin::attributes('slides'), $slides);
                 }
             } else {
                 if (has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                     if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                         $slides .= sprintf('<li><div %s>%s</div></li>', FusionCore_Plugin::attributes('full-video'), get_post_meta(get_the_ID(), 'pyre_video', true));
                     }
                     if (has_post_thumbnail()) {
                         $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $image_size);
                         $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                         $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                         $attachment = get_post(get_post_thumbnail_id());
                         $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), FusionCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => $attachment->post_title)));
                     }
                     if ($smof_data['posts_slideshow']) {
                         $i = 2;
                         while ($i <= $smof_data['posts_slideshow_number']) {
                             $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
                             if ($attachment_new_id) {
                                 $attachment_image = wp_get_attachment_image_src($attachment_new_id, $image_size);
                                 $full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                                 $attachment_data = wp_get_attachment_metadata($attachment_new_id);
                                 $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), FusionCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => '')));
                             }
                             $i++;
                         }
                     }
                     $slideshow = sprintf('<div %s><ul %s>%s</ul></div>', FusionCore_Plugin::attributes('recentposts-shortcode-slideshow'), FusionCore_Plugin::attributes('slides'), $slides);
                 }
             }
         }
         if ($title == 'yes') {
             $content .= sprintf('<h4><a href="%s">%s</a></h4>', get_permalink(get_the_ID()), get_the_title());
         }
         if ($meta == 'yes') {
             $comments = '';
             if (get_comments_number(get_the_ID()) >= 1) {
                 $comments = sprintf('<span %s>|</span><a href="%s">%s %s</a></span>', FusionCore_Plugin::attributes('meta-separator'), get_permalink(get_the_ID()), get_comments_number(get_the_ID()), __('Comments', 'Avada'));
             }
             $content .= sprintf('<p %s><span><time %s>%s</time></span>%s</p>', FusionCore_Plugin::attributes('meta'), FusionCore_Plugin::attributes('date'), get_the_time($smof_data['date_format'], get_the_ID()), $comments);
         }
         if ($excerpt == 'yes') {
             $content .= tf_content($excerpt_words, $strip_html);
         }
         if ($count == self::$args['columns']) {
             $count = 0;
             $items .= sprintf('<article %s>%s%s<div %s>%s</div></article><div class="fusion-clearfix"></div>', FusionCore_Plugin::attributes('recentposts-shortcode-column'), $date_box, $slideshow, FusionCore_Plugin::attributes('recent-posts-content'), $content);
         } else {
             $items .= sprintf('<article %s>%s%s<div %s>%s</div></article>', FusionCore_Plugin::attributes('recentposts-shortcode-column'), $date_box, $slideshow, FusionCore_Plugin::attributes('recent-posts-content'), $content);
         }
         $count++;
     }
     $html = sprintf('<div %s><section %s><div %s>%s</div></section></div>', FusionCore_Plugin::attributes('recentposts-shortcode'), FusionCore_Plugin::attributes('recentposts-shortcode-section'), FusionCore_Plugin::attributes('row holder'), $items);
     wp_reset_query();
     return $html;
 }
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:101,代码来源:class-recent-posts.php

示例2: avada_number_of_featured_images

 function avada_number_of_featured_images()
 {
     global $post;
     $number_of_images = 0;
     if (has_post_thumbnail() && 'yes' != get_post_meta($post->ID, 'pyre_show_first_featured_image', true)) {
         $number_of_images++;
     }
     for ($i = 2; $i <= Avada()->settings->get('posts_slideshow_number'); $i++) {
         $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, $post->post_type);
         if ($attachment_new_id) {
             $number_of_images++;
         }
     }
     return $number_of_images;
 }
开发者ID:rvelezc,项目名称:drpelaezgo.com,代码行数:15,代码来源:custom_functions.php

示例3: get_post_meta

                    ?>
"><img src="<?php 
                    echo $attachment_image[0];
                    ?>
" alt="<?php 
                    echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
                    ?>
" /></a>
					</li>
					<?php 
                }
                ?>
					<?php 
                $i = 2;
                while ($i <= $smof_data['posts_slideshow_number']) {
                    $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'page');
                    if ($attachment_new_id) {
                        ?>
					<?php 
                        $attachment_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                        ?>
					<?php 
                        $full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                        ?>
					<?php 
                        $attachment_data = wp_get_attachment_metadata($attachment_new_id);
                        ?>
					<li>
						<a href="<?php 
                        echo $full_image[0];
                        ?>
开发者ID:ftopolovec,项目名称:proart,代码行数:31,代码来源:page.php

示例4: get_post_meta

                        ?>
" alt="<?php 
                        echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
                        ?>
" />
						<?php 
                    }
                    ?>
					</li>
					<?php 
                }
                ?>
					<?php 
                $i = 2;
                while ($i <= Avada()->settings->get('posts_slideshow_number')) {
                    $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'avada_portfolio');
                    if ($attachment_new_id) {
                        ?>
					<?php 
                        $attachment_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                        ?>
					<?php 
                        $full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                        ?>
					<?php 
                        $attachment_data = wp_get_attachment_metadata($attachment_new_id);
                        ?>
					<li>
						<?php 
                        if (!Avada()->settings->get('status_lightbox') && !Avada()->settings->get('status_lightbox_single')) {
                            ?>
开发者ID:hkillam,项目名称:SolarDynamics,代码行数:31,代码来源:single-avada_portfolio.php

示例5: venedor_shortcode_posts


//.........这里部分代码省略.........
                                        <div class="post-slideshow-wrap <?php 
                        echo $layout;
                        ?>
">
                                            <div id="post-slideshow-<?php 
                        echo $post->ID;
                        ?>
" class="post-slideshow owl-carousel">
                                                <?php 
                        $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                        ?>
                                                <?php 
                        $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                        ?>
                                                <?php 
                        $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                        ?>
                                                <div class="post-image">
                                                    <img src="<?php 
                        echo str_replace(array('http:', 'https:'), '', $attachment_image[0]);
                        ?>
" alt="<?php 
                        echo get_post_field('post_excerpt', get_post_thumbnail_id());
                        ?>
" data-image="<?php 
                        echo $venedor_settings['post-zoom'] ? $full_image[0] : '';
                        ?>
" />
                                                </div>

                                                <?php 
                        $i = 2;
                        while ($i <= $venedor_settings['post-slideshow-count']) {
                            $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
                            if ($attachment_new_id) {
                                ?>
                                                        <?php 
                                $attachment_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                                ?>
                                                        <?php 
                                $full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                                ?>
                                                        <?php 
                                $attachment_data = wp_get_attachment_metadata($attachment_new_id);
                                ?>
                                                        <div class="post-image">
                                                            <img src="<?php 
                                echo str_replace(array('http:', 'https:'), '', $attachment_image[0]);
                                ?>
" alt="<?php 
                                echo get_post_field('post_content', $attachment_new_id);
                                ?>
" data-image="<?php 
                                echo $venedor_settings['post-zoom'] ? $full_image[0] : '';
                                ?>
" />
                                                        </div>
                                                    <?php 
                            }
                            $i++;
                        }
                        ?>
                                            </div>
                                            <?php 
                        if ($venedor_settings['post-zoom']) {
                            ?>
开发者ID:robwri32,项目名称:garland,代码行数:67,代码来源:posts.php

示例6: shortcode_recent_posts


//.........这里部分代码省略.........
				if($data['posts_slideshow']):
				foreach($attachments as $attachment):
				$attachment_image = wp_get_attachment_image_src($attachment->ID, 'recent-posts');
				$full_image = wp_get_attachment_image_src($attachment->ID, 'full');
				$attachment_data = wp_get_attachment_metadata($attachment->ID);
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'. $attachment_image[0].'" alt="'.$attachment->post_title.'" /></a>
				</li>';
				endforeach;
				endif;
			$html .= '</ul>
		</div>';
		endif;
		else:
		if(has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)):
		$html .= '<div class="flexslider floated-post-slideshow'.$animation_class.'"'.$animation_attribues.'>';
			$html .= '<ul class="slides">';
				if(get_post_meta(get_the_ID(), 'pyre_video', true)):
				$html .= '<li><div class="full-video">';
					$html .= get_post_meta(get_the_ID(), 'pyre_video', true);
				$html .= '</div></li>';
				endif;
				if(has_post_thumbnail()):
				$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'recent-posts');
				$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
				$attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'.$attachment_image[0].'" alt="'.get_the_title().'" /></a>
				</li>';
				endif;
				if($data['posts_slideshow']):
				$i = 2;
				while($i <= $data['posts_slideshow_number']):
				$attachment_new_id = kd_mfi_get_featured_image_id('featured-image-'.$i, 'post');
				if($attachment_new_id):
				$attachment_image = wp_get_attachment_image_src($attachment_new_id, 'recent-posts');
				$full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
				$attachment_data = wp_get_attachment_metadata($attachment_new_id);
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'. $attachment_image[0].'" alt="" /></a>
				</li>';
				endif; $i++; endwhile;
				endif;
			$html .= '</ul>
		</div>';
		endif;
		endif;
		endif;
		if($atts['title'] == "yes"):
		$html .= '<h4><a href="'.get_permalink(get_the_ID()).'">'.get_the_title().'</a></h4>';
		endif;
		if($atts['meta'] == "yes"):
		$html .= '<ul class="meta">';
		$html .= '<li><em class="date">'.get_the_time($data['date_format'], get_the_ID()).'</em></li>';
		if(get_comments_number(get_the_ID()) >= 1):
		$html .= '<li><a href="'.get_permalink(get_the_ID()).'">'.get_comments_number(get_the_ID()).' '.__('Comments', 'Avada').'</a></li>';
		endif;
		$html .= '</ul>';
		endif;
		if($atts['excerpt'] == "yes"):
		$stripped_content = tf_content( $atts['excerpt_words'], $atts['strip_html'] );
		$html .= '<p>'.$stripped_content.'</p>';
		endif;
		$html .= '</article>';
		$count++;
		endwhile;
开发者ID:verbazend,项目名称:AWFA,代码行数:67,代码来源:shortcodes.php

示例7: get_post_thumbnails

 function get_post_thumbnails($post_id, $count = '')
 {
     global $smof_data;
     $attachment_ids = array();
     if (get_post_thumbnail_id($post_id)) {
         $attachment_ids[] = get_post_thumbnail_id($post_id);
     }
     $i = 2;
     while ($i <= $smof_data['posts_slideshow_number']) {
         if (kd_mfi_get_featured_image_id('featured-image-' . $i, 'post')) {
             $attachment_ids[] = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
         }
         $i++;
     }
     if (isset($count) && $count >= 1) {
         $attachment_ids = array_slice($attachment_ids, 0, $count);
     }
     return $attachment_ids;
 }
开发者ID:jolay,项目名称:maga2.0,代码行数:19,代码来源:class-blog.php

示例8: do_shortcode

                                 <li class="video-container">                        
                                     <?php 
     echo do_shortcode('[vimeo id="' . get_post_meta($post->ID, 'pyre_vimeo', true) . '"]');
     ?>
                                 </li>
                                 <?php 
 }
 ?>
                                 
                                 
                                 <?php 
 $extra = '';
 $i = 2;
 while ($i <= $data['featured_images_count']) {
     $attachment = new StdClass();
     $attachment_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
     if ($attachment_id) {
         ?>
                                         <?php 
         $attachment_image = wp_get_attachment_image_src($attachment_id, $thumbnail);
         ?>
                                         <?php 
         $full_image = wp_get_attachment_image_src($attachment_id, 'full');
         ?>
                                         <?php 
         $attachment_data = wp_get_attachment_metadata($attachment_id);
         ?>
                                  
                                         <?php 
         $extra .= '<li><a href="' . get_permalink() . '"><img src="' . $attachment_image[0] . '" alt="' . $attachment_data['image_meta']['title'] . '" ></a></li>';
         ?>
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:31,代码来源:index-style-masonry.php

示例9: avada_number_of_featured_images

 function avada_number_of_featured_images()
 {
     global $smof_data, $post;
     $number_of_images = 0;
     if (has_post_thumbnail() && get_post_meta($post->ID, 'pyre_show_first_featured_image', true) != 'yes') {
         $number_of_images++;
     }
     for ($i = 2; $i <= $smof_data['posts_slideshow_number']; $i++) {
         $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, $post->post_type);
         if ($attachment_new_id) {
             $number_of_images++;
         }
     }
     return $number_of_images;
 }
开发者ID:mathewdenis,项目名称:avada,代码行数:15,代码来源:custom_functions.php

示例10: while

		<div class="main_image_wrapper">
			<?php 
if (isset($img[0])) {
    ?>
				<div class="image_wrapper carousel">
					<ul class="animals-open-carousel">
						<li><img src="<?php 
    echo $img[0];
    ?>
 "<?php 
    echo $img_style;
    ?>
 class="open_entry_image" alt="" /></li>
					<?php 
    while ($i <= 5) {
        $attachment_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'animals_places');
        if ($attachment_id) {
            $featured_img = wp_get_attachment_image_src($attachment_id, 'large-image');
            echo '<li><img src="' . $featured_img[0] . '" class="open_entry_image" alt="" /></li>';
            $attachments_count = ++$attachments_count;
        }
        $i++;
    }
    ?>
					</ul>
					<?php 
    if ($attachments_count > 1) {
        ?>
						<div class="animals-open-left"></div>
						<div class="animals-open-right"></div>
					<?php 
开发者ID:chicosilva,项目名称:olharambiental,代码行数:31,代码来源:content-animals_places.php

示例11: the_post_thumbnail

            ?>
							<li>
								<a href="<?php 
            echo $full_image[0];
            ?>
" rel="prettyPhoto['gallery']"><?php 
            the_post_thumbnail('full');
            ?>
</a>                                    
							</li>
                        <?php 
        }
        $i = 2;
        while ($i <= $data['featured_images_count']) {
            $attachment = new StdClass();
            $attachment->ID = kd_mfi_get_featured_image_id('featured-image-' . $i, 'creativo_portfolio');
            if ($attachment->ID) {
                ?>
							
							<?php 
                $full_image = wp_get_attachment_image_src($attachment->ID, 'full');
                ?>
							<?php 
                $attachment_data = wp_get_attachment_metadata($attachment->ID);
                ?>
								<li>	
									<a href="<?php 
                echo $full_image[0];
                ?>
" rel="prettyPhoto['gallery']"><img src="<?php 
                echo $full_image[0];
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:31,代码来源:single-creativo_portfolio.php

示例12: shortcode_recent_posts

function shortcode_recent_posts($atts, $content = null)
{
    extract(shortcode_atts(array('grid_display' => 'grid', 'posts' => '4', 'columns' => '4', 'thumbnail' => 'yes', 'show_title' => 'yes', 'show_date' => 'yes', 'include' => '', 'show_excerpt' => 'yes', 'excerpt_length' => '15', 'category' => '', 'taxonomies' => '', 'style' => 'default', 'post_title_color' => '#444444', 'post_title_font_size' => '15px', 'font_weight' => '600', 'post_title_uppercase' => 'no', 'post_date_color' => '#b5b8bf', 'post_desc_font_size' => '13px', 'post_desc_text_color' => '#656565', 'post_desc_bg_color' => '#ffffff', 'offset' => '', 'el_class' => ''), $atts));
    global $data, $post_counter;
    $current_link = $_SERVER["REQUEST_URI"];
    // add an unique class to each button
    if (strpos($current_link, 'vc_editable=true')) {
        $post_counter = rand();
    } else {
        if (!isset($post_counter)) {
            $post_counter = 1;
        } else {
            $post_counter++;
        }
    }
    $styles_render = '';
    if ($style == 'custom') {
        $styles_render = '<style type="text/css" scoped="scoped">';
        $styles_render .= '.post_scope_' . $post_counter . ' .blogpost .description {';
        $styles_render .= 'background-color: ' . $post_desc_bg_color . ';';
        $styles_render .= 'color:' . $post_desc_text_color . ';';
        $styles_render .= 'font-size:' . $post_desc_font_size . '; line-height: 1.6;';
        $styles_render .= '}';
        $styles_render .= '.post_scope_' . $post_counter . ' .blogpost h3 a {';
        $styles_render .= 'color:' . $post_title_color . ';';
        $styles_render .= '}';
        $styles_render .= '.post_scope_' . $post_counter . ' .blogpost h3 {';
        $styles_render .= 'font-size:' . $post_title_font_size . ';';
        $styles_render .= 'font-weight:' . $font_weight . ';';
        if ($post_title_uppercase == 'yes') {
            $styles_render .= 'text-transform:uppercase;';
        }
        $styles_render .= '}';
        $styles_render .= '.post_scope_' . $post_counter . ' .blogpost .date {';
        $styles_render .= 'color:' . $post_date_color . ';';
        $styles_render .= '}';
        $styles_render .= '</style>';
    }
    $post_extra_css_class = $style == 'custom' ? 'post_scope_' . $post_counter : '';
    $attachment = '';
    $html = '';
    if ($show_excerpt != "yes" || $thumbnail != "yes") {
        $height = 'style="height:auto"';
    }
    $thumb = 'recent-posts';
    if ($columns == 3) {
        $thumb = 'recent-posts-col-3';
    }
    if ($columns == 2) {
        $thumb = 'recent-posts-col-2';
    }
    $html .= $styles_render;
    $html .= '<div class="recent_posts_container ' . $post_extra_css_class . ' clearfix">';
    if ($grid_display == 'masonry') {
        $html .= '<div class="grid-masonry js-masonry clearfix">';
        $html .= '<div class="gutter-sizer"></div>';
    } else {
        $html .= '<div class="is_grid clearfix">';
    }
    $query = array('posts_per_page' => $posts, 'post_type' => 'post');
    if ($offset) {
        $query['offset'] = $offset;
    }
    if ($include) {
        $query['post__in'] = explode(',', $include);
    }
    if ($category) {
        $query['cat'] = $category;
    }
    if ($taxonomies) {
        $query['cat'] = $taxonomies;
    }
    $recent_posts = new WP_Query($query);
    $count = 1;
    $i = 3;
    while ($recent_posts->have_posts()) {
        $recent_posts->the_post();
        $html .= '<div class="blogpost grid_posts columns-' . $columns . '">';
        if ($thumbnail == "yes") {
            $post = new StdClass();
            $post->ID = get_the_ID();
            if (has_post_thumbnail() || get_post_meta($post->ID, 'pyre_youtube', true) || get_post_meta($post->ID, 'pyre_vimeo', true)) {
                $html .= '<div class="flexslider mini posts-grid">';
                $html .= '<ul class="slides">';
                if (get_post_meta($post->ID, 'pyre_youtube', true)) {
                    $html .= '<li>';
                    $html .= '<div class="video-container" style="height:12px;"><iframe title="YouTube video player" width="218px" height="134px" src="http://www.youtube.com/embed/' . get_post_meta($post->ID, 'pyre_youtube', true) . '" frameborder="0" allowfullscreen></iframe></div>';
                    $html .= '</li>';
                }
                if (get_post_meta($post->ID, 'pyre_vimeo', true)) {
                    $html .= '<li>';
                    $html .= '<div class="video-container" style="height:12px;"><iframe src="http://player.vimeo.com/video/' . get_post_meta($post->ID, 'pyre_vimeo', true) . '" width="220px" height="161px" frameborder="0"></iframe></div>';
                    $html .= '</li>';
                }
                $extra = '';
                $fi = 2;
                while ($fi <= $data['featured_images_count']) {
                    $attachment = new StdClass();
                    $attachment->ID = kd_mfi_get_featured_image_id('featured-image-' . $fi, 'post');
                    if ($attachment->ID) {
//.........这里部分代码省略.........
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:101,代码来源:shortcodes.php

示例13: render


//.........这里部分代码省略.........
         $recent_posts->the_post();
         $attachment = $date_box = $slideshow = $slides = $content = '';
         if ($layout == 'date-on-side') {
             switch (get_post_format()) {
                 case 'gallery':
                     $format_class = 'images';
                     break;
                 case 'link':
                     $format_class = 'link';
                     break;
                 case 'image':
                     $format_class = 'image';
                     break;
                 case 'quote':
                     $format_class = 'quotes-left';
                     break;
                 case 'video':
                     $format_class = 'film';
                     break;
                 case 'audio':
                     $format_class = 'headphones';
                     break;
                 case 'chat':
                     $format_class = 'bubbles';
                     break;
                 default:
                     $format_class = 'pen';
                     break;
             }
             $date_box = sprintf('<div %s><div %s><span %s>%s</span><span %s>%s</span></div><div %s><i %s></i></div></div>', FusionCore_Plugin::attributes('fusion-date-and-formats'), FusionCore_Plugin::attributes('fusion-date-box updated'), FusionCore_Plugin::attributes('fusion-date'), get_the_time($smof_data['alternate_date_format_day']), FusionCore_Plugin::attributes('fusion-month-year'), get_the_time($smof_data['alternate_date_format_month_year']), FusionCore_Plugin::attributes('fusion-format-box'), FusionCore_Plugin::attributes('fusion-icon-' . $format_class));
         }
         if ($thumbnail == 'yes' && $layout != 'date-on-side' && !post_password_required(get_the_ID())) {
             if ($layout == 'default') {
                 $image_size = 'recent-posts';
             } elseif ($layout == 'thumbnails-on-side') {
                 $image_size = 'portfolio-five';
             }
             if (has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                 if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                     $slides .= sprintf('<li><div %s>%s</div></li>', FusionCore_Plugin::attributes('full-video'), get_post_meta(get_the_ID(), 'pyre_video', true));
                 }
                 if (has_post_thumbnail()) {
                     $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $image_size);
                     $attachment_img_tag = wp_get_attachment_image(get_post_thumbnail_id(), $image_size);
                     $attachment_img_tag_custom = sprintf('<img src="%s" alt="%s" />', $attachment_image[0], get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true));
                     $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                     $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                     $attachment = get_post(get_post_thumbnail_id());
                     $slides .= sprintf('<li><a href="%s" %s>%s</a></li>', get_permalink(get_the_ID()), FusionCore_Plugin::attributes('recentposts-shortcode-img-link'), $attachment_img_tag_custom);
                 }
                 $i = 2;
                 while ($i <= $smof_data['posts_slideshow_number']) {
                     $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
                     if ($attachment_new_id) {
                         $attachment_image = wp_get_attachment_image_src($attachment_new_id, $image_size);
                         $attachment_img_tag = wp_get_attachment_image($attachment_new_id, $image_size);
                         $attachment_img_tag_custom = sprintf('<img src="%s" alt="%s" />', $attachment_image[0], get_post_meta($attachment_new_id, '_wp_attachment_image_alt', true));
                         $full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                         $attachment_data = wp_get_attachment_metadata($attachment_new_id);
                         $slides .= sprintf('<li><a href="%s" %s>%s</a></li>', get_permalink(get_the_ID()), FusionCore_Plugin::attributes('recentposts-shortcode-img-link'), $attachment_img_tag_custom);
                     }
                     $i++;
                 }
                 $slideshow = sprintf('<div %s><ul %s>%s</ul></div>', FusionCore_Plugin::attributes('recentposts-shortcode-slideshow'), FusionCore_Plugin::attributes('slides'), $slides);
             }
         }
         if ($title == 'yes') {
             $content .= avada_render_rich_snippets_for_pages(false);
             $entry_title = '';
             if (!$smof_data['disable_date_rich_snippet_pages']) {
                 $entry_title = 'entry-title';
             }
             $content .= sprintf('<h4 class="%s"><a href="%s">%s</a></h4>', $entry_title, get_permalink(get_the_ID()), get_the_title());
         } else {
             $content .= avada_render_rich_snippets_for_pages();
         }
         if ($meta == 'yes') {
             $comments = $comments_link = '';
             ob_start();
             comments_popup_link(__('0 Comments', 'fusion-core'), __('1 Comment', 'fusion-core'), '% ' . __('Comments', 'fusion-core'));
             $comments_link = ob_get_contents();
             ob_get_clean();
             $comments = sprintf('<span %s>|</span><span>%s</span>', FusionCore_Plugin::attributes('meta-separator'), $comments_link);
             $content .= sprintf('<p %s><span><span %s>%s</span></span>%s</p>', FusionCore_Plugin::attributes('meta'), FusionCore_Plugin::attributes('date'), get_the_time($smof_data['date_format'], get_the_ID()), $comments);
         }
         if ($excerpt == 'yes') {
             $content .= fusion_get_post_content('', 'yes', $excerpt_words, $strip_html);
         }
         if ($count == self::$args['columns']) {
             $count = 0;
             $items .= sprintf('<div %s>%s%s<div %s>%s</div></div><div class="fusion-clearfix"></div>', FusionCore_Plugin::attributes('recentposts-shortcode-column'), $date_box, $slideshow, FusionCore_Plugin::attributes('recent-posts-content'), $content);
         } else {
             $items .= sprintf('<div %s>%s%s<div %s>%s</div></div>', FusionCore_Plugin::attributes('recentposts-shortcode-column'), $date_box, $slideshow, FusionCore_Plugin::attributes('recent-posts-content'), $content);
         }
         $count++;
     }
     $html = sprintf('<div %s><section %s>%s</section></div>', FusionCore_Plugin::attributes('recentposts-shortcode'), FusionCore_Plugin::attributes('recentposts-shortcode-section'), $items);
     wp_reset_query();
     return $html;
 }
开发者ID:agiper,项目名称:wordpress,代码行数:101,代码来源:class-recent-posts.php

示例14: vh_load_movies_list


//.........这里部分代码省略.........
    if ($post_date == '' || $post_date == 'NaN.NaN.NaN') {
        $post_date = date('m.d.Y');
    }
    $current_date = explode(".", $post_date);
    if ($show_all == '1') {
        $args = array('numberposts' => -1, 'post_type' => 'movies', 'event_categories' => $cat_id, 'posts_per_page' => -1);
    } else {
        $args = array('numberposts' => -1, 'posts_per_page' => -1, 'post_type' => 'movies', 'event_categories' => $cat_id, 'meta_query' => array(array('key' => 'movie_time_values', 'value' => $post_date, 'compare' => 'LIKE')));
    }
    $the_query = new WP_Query($args);
    if ($the_query->have_posts()) {
        $output .= '<ul class="event_container">';
        while ($the_query->have_posts()) {
            $the_query->the_post();
            try {
                $dt = new DateTime('', new DateTimeZone(get_option('timezone_string')));
            } catch (Exception $e) {
                if (strlen($e->getMessage()) > 1) {
                    $dt = new DateTime('', new DateTimeZone('UTC'));
                }
            }
            $now = strtotime($dt->format('H:00'));
            $now = date('H:00', $now);
            $values = trim(get_post_meta(get_post()->ID, 'movie_time_values', true), ',');
            $values_arr = json_decode('{"events":[' . $values . ']}', true);
            foreach ($values_arr as $value) {
                foreach ($value as $info) {
                    $movie_date = explode(".", $info['date']);
                    if ($post_date != '' && (strtotime($movie_date["2"] . "-" . $movie_date["0"] . "-" . $movie_date["1"]) == strtotime($current_date["2"] . "-" . $current_date["0"] . "-" . $current_date["1"]) && $show_all != '1' || strtotime($movie_date["2"] . "-" . $movie_date["0"] . "-" . $movie_date["1"]) >= strtotime($current_date["2"] . "-" . $current_date["0"] . "-" . $current_date["1"]) && $show_all == '1')) {
                        if ($theatre == '') {
                            $output .= '<li class="event_list vc_span12" id="post-' . get_the_ID() . '">';
                            $output .= '<div class="movie_list_image shadows">';
                            $output .= '<div class="bottom_line"></div>';
                            if (kd_mfi_get_featured_image_id('event-poster', 'movies') != '') {
                                $attachment_id = kd_mfi_get_featured_image_id('event-poster', 'movies');
                                $image = wp_get_attachment_image_src($attachment_id, 'movie_list');
                                $output .= '<a href="' . get_permalink(get_the_ID()) . '"><img src="' . $image[0] . '"></a>';
                            } elseif (has_post_thumbnail(get_post()->ID)) {
                                $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_post()->ID), 'movie_list');
                                $output .= '<a href="' . get_permalink(get_the_ID()) . '"><img src="' . $image[0] . '"></a>';
                            }
                            $output .= '</div>';
                            $output .= '<div class="movie_list_container">';
                            $output .= '<div class="movie_title"><a href="' . get_permalink(get_the_ID()) . '">' . get_the_title() . '</a></div>';
                            if (function_exists('the_ratings')) {
                                $rating_images = substr_replace(the_ratings_results($post->ID), '', strlen(the_ratings_results($post->ID)) - 5);
                                $rating_value = number_format(floatval(substr(the_ratings_results(get_the_ID()), strlen(the_ratings_results(get_the_ID())) - 5)), 1);
                                if ($rating_value < 10) {
                                    $rating_value = ' ' . $rating_value;
                                }
                                $output .= '<div class="event_list_rating">' . $rating_images . $rating_value . '</div>';
                            }
                            $tc = wp_count_comments(get_the_ID());
                            $output .= '<span class="comments icon-comment">' . $tc->total_comments . '</span>';
                            $output .= '<div class="overview-container">
															<div class="main_side_left">';
                            $categories = wp_get_post_terms(get_the_ID(), 'event_categories', array("fields" => "names"));
                            $categories_count = count($categories);
                            $categories_val = 1;
                            $categories_string = '';
                            foreach ($categories as $value) {
                                if ($categories_val == $categories_count) {
                                    $categories_string = $categories_string . $value;
                                } else {
                                    $categories_string = $categories_string . $value . ', ';
                                }
开发者ID:vurusarakolenler,项目名称:fethiyespor,代码行数:67,代码来源:functions.php

示例15: while

$i = 2;
$attachments_count = 1;
if (isset($img[0])) {
    ?>
				<div class="image_wrapper carousel">
					<ul class="donation-open-carousel">
						<li><img src="<?php 
    echo $img[0];
    ?>
 "<?php 
    echo $img_style;
    ?>
 class="open_entry_image" alt="" /></li>
					<?php 
    while ($i <= 5) {
        $attachment_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'donations');
        if ($attachment_id) {
            $featured_img = wp_get_attachment_image_src($attachment_id, 'large-image');
            echo '<li><img src="' . $featured_img[0] . '" class="open_entry_image" alt="" /></li>';
            $attachments_count = ++$attachments_count;
        }
        $i++;
    }
    ?>
					</ul>
					<?php 
    if ($attachments_count > 1) {
        ?>
						<div class="donation-open-left"></div>
						<div class="donation-open-right"></div>
					<?php 
开发者ID:chicosilva,项目名称:olharambiental,代码行数:31,代码来源:content-donations.php


注:本文中的kd_mfi_get_featured_image_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。