本文整理汇总了PHP中the_post_thumbnail_caption函数的典型用法代码示例。如果您正苦于以下问题:PHP the_post_thumbnail_caption函数的具体用法?PHP the_post_thumbnail_caption怎么用?PHP the_post_thumbnail_caption使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_post_thumbnail_caption函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: bones_slider_template
function bones_slider_template($id)
{
// Query Arguments
$args = array('post_type' => 'slides', 'posts_per_page' => 5, 'cat' => $id);
// The Query
$the_query = new WP_Query($args);
// Check if the Query returns any posts
if ($the_query->have_posts()) {
// Start the Slider
?>
<div class="flexslider">
<ul class="slides">
<?php
// The Loop
while ($the_query->have_posts()) {
$the_query->the_post();
?>
<li>
<?php
// Check if there's a Slide URL given and if so let's a link to it
if (get_post_meta(get_the_id(), 'bones_slideurl', true) != '') {
?>
<a href="<?php
echo esc_url(get_post_meta(get_the_id(), 'bones_slideurl', true));
?>
">
<?php
}
// The Slide's Image
echo the_post_thumbnail('orig');
// Close off the Slide's Link if there is one
if (get_post_meta(get_the_id(), 'bones_slideurl', true) != '') {
?>
</a>
<?php
}
?>
<div class=flex-caption>
<?php
the_post_thumbnail_caption();
?>
</div> <!-- .flex-caption -->
</li>
<?php
}
?>
</ul><!-- .slides -->
</div><!-- .flexslider -->
<?php
}
// Reset Post Data
wp_reset_postdata();
}
开发者ID:jocher,项目名称:httpdocs,代码行数:59,代码来源:slider.php
示例2: test_the_post_thumbnail_caption
/**
* @ticket 12235
*/
function test_the_post_thumbnail_caption()
{
$caption = 'This is a caption.';
$post_id = self::factory()->post->create();
$attachment_id = self::factory()->attachment->create_object('image.jpg', $post_id, array('post_mime_type' => 'image/jpeg', 'post_type' => 'attachment', 'post_excerpt' => $caption));
set_post_thumbnail($post_id, $attachment_id);
ob_start();
the_post_thumbnail_caption($post_id);
$this->assertEquals($caption, ob_get_clean());
}
开发者ID:inpsyde,项目名称:wordpress-dev,代码行数:13,代码来源:thumbnails.php
示例3: get_the_category
$categories = get_the_category($post->ID);
foreach ($categories as $category) {
$children = get_categories(array('parent' => $category->term_id));
$has_children = count($children);
if ($has_children == 0) {
echo $category->name;
}
}
?>
</div>
</header><!-- .entry-header -->
</div>
<figcaption class='caption feature-caption L-1-1'>
<?php
the_post_thumbnail_caption();
?>
</figcaption>
<!-- Reset query after query -->
<?php
wp_reset_postdata();
?>
</div>
<div class="entry-content trunk">
<aside class='sidebar L-1-3 M-1-1 gutters'>
<div class='float-container'>
<div class="related-cat gutters L-1-1 M-1-3 S-1-2">
开发者ID:baerdaniel,项目名称:MAT-wordpress,代码行数:31,代码来源:content-single.php
示例4: get_header
* This file displays your single posts.
*
* @package Podcaster
* @since 1.0
* @author Theme Station
* @copyright Copyright (c) 2014, Theme Station
* @link http://www.themestation.co
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Loads the header.php template*/
get_header();
$options = get_option('podcaster-theme');
$thst_wp_version = get_bloginfo('version');
$format = get_post_format();
//$thump_cap = get_post(get_post_thumbnail_id())->post_excerpt;
$thump_cap = the_post_thumbnail_caption();
$featured_post_header = get_post_meta($post->ID, 'cmb_thst_feature_post_img', true);
$image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '');
$header_img = $image[0];
$pod_plugin_active = get_pod_plugin_active();
$posttype = get_post_type();
$pod_nav_bg = isset($options['pod-nav-bg']) ? $options['pod-nav-bg'] : '';
$pod_blog_layout = isset($options['pod-blog-layout']) ? $options['pod-blog-layout'] : '';
$gallerystyle_global = isset($options['pod-pofo-gallery']) ? $options['pod-pofo-gallery'] : '';
$pod_sticky_header = isset($options['pod-sticky-header']) ? $options['pod-sticky-header'] : '';
$pod_single_header_display = isset($options['pod-single-header-display']) ? $options['pod-single-header-display'] : '';
$pod_single_header_par = isset($options['pod-single-header-par']) ? $options['pod-single-header-par'] : '';
$pod_single_bg_style = isset($options['pod-single-bg-style']) ? $options['pod-single-bg-style'] : '';
$pod_single_header_bgstyle = isset($options['pod-single-bg-style']) ? $options['pod-single-bg-style'] : '';
$pod_header_par = isset($options['pod-single-header-par']) ? $options['pod-single-header-par'] : '';
$pod_single_video_bg = isset($options['pod-single-video-bg']) ? $options['pod-single-video-bg'] : '';
开发者ID:rmens,项目名称:podcaster,代码行数:31,代码来源:single.php
示例5: while
$j=0;
while (have_posts()) : the_post(); ?>
<?php if ($j==0): ?>
<div class="db-story-c1">
<span class="db-section-date">
<h4><?php the_category(', ');?></h4>
<h4>|</h4>
<h5><?php the_time('F j, g:i a');?> </h5>
</span>
<h2 class="db-large-title">
<a href="<?php the_permalink(); ?>"><?php the_headline(); ?></a>
</h2>
<div class="db-image db-section-cp text-center">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('db-mult-full'); ?></a>
<p class="db-image-caption text-left">
<?php the_post_thumbnail_caption() ?>
</p>
</div>
<?php the_byline_front(); ?>
<?php the_audio(); ?>
</br>
<p>
<?php echo get_the_excerpt(); ?>
</p>
</div>
<hr>
<?php ++$j; ?>
<?php else: ?>
<?php if ($i==0): ?>
<div class="row">
<?php endif; ?>
开发者ID:nbedi,项目名称:caeruleum,代码行数:31,代码来源:loop.php
注:本文中的the_post_thumbnail_caption函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论