コード例 #1
0
ファイル: slider.php プロジェクト: jocher/httpdocs
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();
}
コード例 #2
0
ファイル: thumbnails.php プロジェクト: inpsyde/wordpress-dev
 /**
  * @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());
 }
コード例 #3
0
$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">
コード例 #4
0
ファイル: single.php プロジェクト: rmens/podcaster
 * 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'] : '';
コード例 #5
0
ファイル: loop.php プロジェクト: nbedi/caeruleum
       $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; ?>