本文整理汇总了PHP中MultiPostThumbnails::the_post_thumbnail方法的典型用法代码示例。如果您正苦于以下问题:PHP MultiPostThumbnails::the_post_thumbnail方法的具体用法?PHP MultiPostThumbnails::the_post_thumbnail怎么用?PHP MultiPostThumbnails::the_post_thumbnail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiPostThumbnails
的用法示例。
在下文中一共展示了MultiPostThumbnails::the_post_thumbnail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: the_post_thumbnail
/**
* Use Multi Post Thumbnails to output the HTML necessary for displaying a custom
* post thumbnail.
*
* @param string $type The type of post thumbnail to display.
* @param string $size The size of the post thumbnail.
*/
public function the_post_thumbnail($type, $size)
{
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), $type, get_the_ID(), $size);
} else {
echo '';
}
}
示例2: while
</h1>
</div>
<div class="col-xs-12 grid">
<div class="row">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<div class="col-xs-12 col-sm-4 ">
<figure class="effect-romeo">
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'portfolio-archive-image');
}
?>
<figcaption>
<h2>
<?php
$words = explode(' ', the_title('', '', false));
$words[1] = '<span>' . $words[1] . '</span>';
$title = implode(' ', $words);
echo $title;
?>
</h2>
<p><?php
echo excerpt(30);
?>
示例3:
?>
<figcaption>
<?php
if (dynamic_sidebar('featured-center')) {
}
?>
</figcaption>
</figure>
</article>
<article class="featured-content col-xs-12 col-md-4 col-lg-3 first">
<figure class="featured-img">
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'third-featured-image');
}
?>
<figcaption>
<?php
if (dynamic_sidebar('featured-right')) {
}
?>
</figcaption>
</figure>
</article>
</div>
</div> <!-- .index-content .col-xs-12 -->
<?php
示例4: while
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
}
the_content();
}
?>
</p>
</div>
</div>
<div class="col-md-3">
<?php
add_image_size('custom-size', 263, 263);
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-2', NULL, 'custom-size');
}
?>
</div>
</div>
</section>
<section class="why">
<div class="container">
<div class="row" style="border-bottom:1px dotted #ccc">
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$wp_query = new WP_Query(array('post_type' => 'post', 'showposts' => '8', 'paged' => $paged, 'order' => 'ASC'));
if ($wp_query->have_posts()) {
while ($wp_query->have_posts()) {
$wp_query->the_post();
?>
示例5:
</div>
<div class="container">
<div class="row">
<div class="main-container flex flex-column flex-j-center">
<div class="single-image flex flex-j-center">
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-3');
}
?>
</div>
<div class="main-container flex flex-j-center">
<div class="single-image flex flex-j-center">
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-4');
}
?>
</div>
</div>
</div>
</div>
<div class="page-links flex flex-j-between flex-j-end">
<div class="previous">
<?php
previous_post_link();
?>
</div>
<div class="next">
<?php
next_post_link();
示例6: wp_count_comments
?>
<i class="fa fa-comments fa-fw"></i><?php
$comments_count = wp_count_comments();
echo $comments_count->total_comments . ' Comments';
?>
</p>
</header>
<div class="content_single">
<div class="post_thumbnails">
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image', NULL, 'post-secondary-image-thumbnail');
}
?>
</div>
<div class="sidebar-wrapper right">
<div class="post-details">
<h4 style="padding:0px;margin:20px 0">Post Details</h4>
<?php
$postid = get_the_ID();
$level = get_post_meta($postid, 'level', 1);
$length = get_post_meta($postid, 'length', 1);
$demo = get_post_meta($postid, 'demo', 1);
$designation = get_post_meta($postid, 'designation', 1);
$r1 = get_post_meta($postid, 'r1', 1);
示例7:
</div>
</div>
<?php
}
?>
<?php
if (!empty($productos[2])) {
?>
<div data-sr="enter top, over 1s" class="col-xs-12 col-sm-4 text-center">
<div class="producto-index">
<div class="producto-images-box">
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'image-1', $post_id = $productos[2], 'part3-1');
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'image-2', $post_id = $productos[2], 'part3-2');
}
?>
<a class="btn btn-warning btn-md text-uppercase" role="button"><?php
echo get_the_title($productos[2]);
?>
</a>
</div>
</div>
</div>
<?php
}
?>
</div>
示例8: wp_get_attachment_image_src
<?php
$large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" alt="" class="tx-colorbox">';
the_post_thumbnail('imax-single-thumb');
echo '</a>';
if (class_exists('MultiPostThumbnails')) {
$large_image_url1 = wp_get_attachment_image_src(MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'feature-image-2', $post->ID), 'large');
if ($large_image_url1) {
echo '<a href="' . $large_image_url1[0] . '" title="' . the_title_attribute('echo=0') . '" class="tx-colorbox">';
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-2', NULL, 'imax-single-thumb');
echo '</a>';
}
$large_image_url2 = wp_get_attachment_image_src(MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'feature-image-3', $post->ID), 'large');
if ($large_image_url2) {
echo '<a href="' . $large_image_url2[0] . '" title="' . the_title_attribute('echo=0') . '" class="tx-colorbox">';
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-3', NULL, 'imax-single-thumb');
echo '</a>';
}
}
?>
</div>
</header><!-- .entry-header -->
<?php
}
?>
<div class="folio-meta">
<?php
if (!empty($sub_title)) {
?>
示例9: printf
<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
}
?>
</div>
示例10: bloginfo
alt= "<?php
bloginfo('name');
?>
"
data-title="<?php
echo esc_html($title);
?>
"
data-description="<?php
echo esc_html($caption);
?>
">
<img class="portfolio-image" src="<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail(get_post_type(), $name);
}
?>
">
</a>
</li>
<?php
}
?>
</ul><!-- og-grid -->
</div> <!-- col-xs-12 -->
</div> <!-- row -->
示例11: the_permalink
echo "first-col";
}
?>
">
<div class="row">
<div class="img-wrap">
<a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
">
<?php
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail('post', 'home-image')) {
MultiPostThumbnails::the_post_thumbnail('post', 'home-image', NULL, 'full', NULL, false);
} else {
?>
<img src="<?php
bloginfo('template_directory');
?>
/assets/img/jkc-no-image-288x140.jpg" alt="<?php
the_title();
?>
" draggable="false">
<?php
}
?>
</a>
</div>
<div class="category">
示例12: theme_offline_image
/**
*
* @param type $id
* @param type $size
* @return type
*/
public static function theme_offline_image($id = null, $size = 'offline-large')
{
if (!isset($id)) {
$id = self::default_id();
}
if (MultiPostThumbnails::has_post_thumbnail('cwp_custom_options', $id)) {
return MultiPostThumbnails::the_post_thumbnail('cwp_custom_options', 'offline-image', $id, $size);
} else {
return false;
}
}
示例13: render_flipper
function render_flipper($atts)
{
extract(shortcode_atts(array('name' => null), $atts));
$featuredCategory = get_category($atts['cat']);
$featuredCategoryParent = $featuredCategory->category_parent;
$flipperCategory = !empty($featuredCategoryParent) ? $featuredCategoryParent : $atts['cat'];
if ($atts['name'] == "home-flipper") {
wp_enqueue_style('mod-flipper');
$args = array('posts_per_page' => 10, 'meta_key' => '_featured-post' . (is_home() ? '-home' : '') . '-order', 'cat' => !empty($flipperCategory) ? $flipperCategory : 0, 'order' => 'ASC', 'orderby' => 'meta_value_num', 'meta_query' => array(array('key' => '_featured-post' . (is_home() ? '-home' : ''), 'value' => 1)));
$featured = new WP_Query($args);
if ($featured->have_posts()) {
?>
<div class="feature-left-wrap left col-17">
<div class="mod-flipper">
<div class="flex-container">
<div class="flexslider <?php
echo $featured->post_count > 1 ? 'hasSlider' : 'noSlider';
?>
" id="flexslider">
<ul class="slides">
<?php
while ($featured->have_posts()) {
$featured->the_post();
?>
<li class="slide">
<div class="img-wrap" data-title="<?php
echo the_title();
?>
" data-smalltitle="<?php
echo substr(the_title(), 0, 35);
?>
" data-text="<?php
echo get_the_excerpt();
?>
" data-href="<?php
echo the_permalink();
?>
">
<a href="<?php
echo the_permalink();
?>
" title="<?php
echo the_title();
?>
">
<?php
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'thumbnail');
$featured_alt = get_post_meta(get_post_thumbnail_id($post->ID), '_wp_attachment_image_alt', true) ?: get_the_title();
$image = $image[0];
?>
<!--<img src="<?php
echo $image;
?>
" alt="<?php
the_title();
?>
" draggable="false">-->
<?php
if (class_exists('MultiPostThumbnails')) {
MultiPostThumbnails::the_post_thumbnail('post', 'flipper-image', NULL, 'large', NULL, false);
}
?>
<?php
} else {
?>
<img src="<?php
bloginfo('template_directory');
?>
/assets/img/jkc-no-image-650x317.jpg" alt="'.the_title().'" draggable="false">';
<?php
}
?>
<!--img onerror="this.src='/img/jkc-no-image-650x317.jpg'" src="http://image.jeanknowscars.com/f/95937843+w650+h317+re0+cr1+ar0/volvo-s90-promolarge.jpg" alt="<?php
echo the_title();
?>
" draggable="false"-->
</a>
</div>
</li>
<?php
}
?>
</ul>
</div>
<?php
$c = 0;
while ($featured->have_posts()) {
$featured->the_post();
if ($c == 0) {
?>
<div class="flipper-info-box">
<a class="flipper-info-title" href="<?php
echo the_permalink();
?>
" title="<?php
echo the_title();
//.........这里部分代码省略.........
示例14: the_post_thumbnail
if (has_post_thumbnail()) {
?>
<aside class="entry-image">
<?php
the_post_thumbnail('large');
?>
</aside>
<?php
}
?>
<?php
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail($post->post_type, $post->post_type . '-secondary', $post->ID)) {
?>
<aside class="entry-image">
<?php
MultiPostThumbnails::the_post_thumbnail($post->post_type, $post->post_type . '-secondary', $post->ID, 'large');
?>
</aside>
<?php
}
?>
<?php
$url = get_post_meta($post->ID, 'entry-url', true);
if (!empty($url)) {
?>
<aside class="entry-url">
<?php
$youtube = strpos(strtolower($url), 'youtube.com');
?>
<?php
$vimeo = strpos(strtolower($url), 'vimeo.com');
示例15: printf
?>
" title="<?php
printf(esc_attr__('Permalink to %s', 'magazino'), the_title_attribute('echo=0'));
?>
" rel="bookmark"><?php
_e('▶', 'magazino');
?>
</a></div>
<?php
//Checks for plugin..
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'grid-thumbnail', strval(get_the_ID()))) {
?>
<div class="post-box-img"><?php
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'grid-thumbnail');
?>
</div>
<?php
} else {
//Plugin not installed
?>
<?php
//Checks for attached post image instead
$postimgs =& get_children(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'exclude' => get_post_thumbnail_id()));
if (!empty($postimgs)) {
$firstimg = array_shift($postimgs);
$th_image = wp_get_attachment_image($firstimg->ID, array(500, 500), false);
?>