Ejemplo n.º 1
0
<?php

/**
 * The template used for displaying page content in page.php
 *
 * @package wphy_moon
 */
if (has_post_thumbnail(get_the_ID())) {
    ?>
	<div class="feature-image">
		<img src="<?php 
    echo get_feature_image_by_id(get_the_ID());
    ?>
" alt="<?php 
    the_title();
    ?>
" class="animated" >
	</div>
<?php 
}
?>
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
	<header class="entry-header">
		<?php 
the_title('<h1 class="entry-title">', '</h1>');
Ejemplo n.º 2
0
    ?>
<div class=" show-case">
  <div class="block-title"><h2><a href="/show-case">案例展示</a></h2></div>
  <div class="row three-image-block">
  <?php 
    $args_case = array('post_type' => get_option('case_type'), 'posts_per_page' => get_option('case_num'));
    $query_case = new WP_Query($args_case);
    if ($query_case->have_posts()) {
        while ($query_case->have_posts()) {
            $query_case->the_post();
            $data = array();
            $image_link = '';
            if (function_exists('get_field')) {
                $image_link = get_image_by_id(get_field('pic'));
            } else {
                $image_link = get_feature_image_by_id(get_the_ID());
            }
            $data = array('title' => get_the_title(), 'excertp' => get_the_excerpt(), 'link' => get_permalink(), 'image' => $image_link);
            ?>
        <div class="col-sm-4 item">
          <?php 
            include locate_template('module/case-block.php');
            ?>
        </div>
        <?php 
        }
    }
    wp_reset_postdata();
    ?>
 
  </div>
Ejemplo n.º 3
0
<div class="limiter">
  <div class="row image-block-area">
    <?php 
    $feature_post_id = array();
    $feature_post_string = get_option('featured_post_id');
    $feature_post = explode(' ', $feature_post_string);
    foreach ($feature_post as $key => $value) {
        $feature_post_ids[] = intval($value);
    }
    if (get_option('use_newest') == 'checked') {
        $feature_post_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 3, 'order' => 'DESC', 'orderby' => 'date'));
    } else {
        $feature_post_query = new WP_Query(array('post_type' => 'post', 'post__in' => $feature_post_ids, 'ignore_sticky_posts' => true));
    }
    if ($feature_post_query->have_posts()) {
        while ($feature_post_query->have_posts()) {
            $data = array();
            $feature_post_query->the_post();
            $data = array('title' => get_the_title(), 'excerpt' => get_the_excerpt(), 'link' => get_permalink(), 'image' => get_feature_image_by_id(get_the_ID()));
            echo '<div class="col-sm-4">';
            include locate_template('module/image-block.php');
            echo '</div>';
        }
    }
    wp_reset_postdata();
    ?>
    
  </div>
</div>
<?php 
}