コード例 #1
0
			<div class="one_third<?php 
        if ($i % 3 == 0) {
            echo ' last ';
        }
        ?>
 animated eff-fadeInUp delay-<?php 
        echo $i;
        ?>
00ms">
				<div class="box">
					<a class="king-post-thumbnail" href="<?php 
        the_permalink();
        ?>
">
						<span><?php 
        echo wp_trim_words($post->post_title, 4);
        ?>
</span>
					<?php 
        $img = king::get_featured_image($post);
        echo '<img src="' . king_createLinkImage($img, '780x400xc') . '" alt="" />';
        ?>
					</a> 
				</div>
		    </div>
		<?php 
        $i++;
    }
} else {
    echo '<h4>' . __('Posts not found', KING_DOMAIN) . '</h4>';
}
コード例 #2
0
ファイル: our-team.php プロジェクト: pivotlearning/wpsite
	
	<div class="one_fourth animated <?php 
                echo esc_attr($eff);
                ?>
 delay-<?php 
                echo esc_attr($i);
                ?>
00ms<?php 
                if ($i % 4 == 0) {
                    echo ' last';
                }
                ?>
">
    	<?php 
                $img = king::get_featured_image($post);
                echo '<img src="' . king_createLinkImage($img, '250x250xc') . '" class="cirimg" alt="" />';
                ?>
        <div class="cinfo">
            <img src="<?php 
                echo esc_url(THEME_URI . '/assets/images/shape1.jpg');
                ?>
" alt="" class="shape1">
        	<h5><?php 
                the_title();
                ?>
</h5>
			<em><?php 
                echo esc_html($options['position']);
                ?>
</em>
            <p class="des"><?php 
コード例 #3
0
?>

	<?php 
$king->breadcrumb();
?>

	<div id="primary" class="site-content container-content content ">
		<div id="content" class="row row-content container blog-2-columns featured_section121">
			<div class="col-md-12">
				<div id="cd-timeline" class="cd-container">
				<?php 
$i = 0;
$limit = get_option('posts_per_page');
while (have_posts()) {
    the_post();
    $img = esc_url(king_createLinkImage($king->get_featured_image($post, true), '120x120xc'));
    ?>
					<div class="cd-timeline-block animated fadeInUp">
						<div class="cd-timeline-img cd-picture animated eff-bounceIn delay-200ms">
							<img src="<?php 
    echo esc_url($img);
    ?>
" alt=""> 
						</div>
						
						<div class="cd-timeline-content animated eff-<?php 
    if ($i % 2 != 0) {
        echo 'fadeInRight';
    } else {
        echo 'fadeInLeft';
    }
コード例 #4
0
ファイル: king.class.php プロジェクト: pivotlearning/wpsite
 public static function slider_img_src($image_id, $width = '', $height = '')
 {
     global $post;
     $img = wp_get_attachment_image_src($image_id, 'full');
     if (!empty($img)) {
         return king_createLinkImage($img[0], $width . 'x' . $height . 'xc');
     }
 }
コード例 #5
0
ファイル: blog-masonry.php プロジェクト: pivotlearning/wpsite
			    <li class="cbp-item<?php 
    echo esc_attr($heighClass);
    ?>
">
			        <a href="<?php 
    echo get_permalink($post->ID);
    ?>
" class="cbp-caption">
			            <div class="cbp-caption-defaultWrap two">
			            <?php 
    $img = $king->get_featured_image($post, true);
    if (!empty($img)) {
        if (strpos($img, 'youtube') !== false) {
            $img = THEME_URI . '/assets/images/default.jpg';
        }
        $img = king_createLinkImage($img, '570x' . $height . 'xc');
        echo '<img alt="' . get_the_title() . '" class="featured-image" src="' . $img . '" />';
    }
    ?>
 
			            </div>
			            <div class="cbp-caption-activeWrap <?php 
    echo esc_attr($cap);
    ?>
">
			                <div class="cbp-l-caption-alignCenter">
			                    <div class="cbp-l-caption-body">
			                        <div class="cbp-l-caption-title"><?php 
    the_title();
    ?>
</div>
コード例 #6
0
        }
        ?>
					
			<div class="one_half <?php 
        if ($i % 2 == 0) {
            echo 'last';
        }
        ?>
">
				<a class="king-post-thumbnail" href="<?php 
        the_permalink();
        ?>
">
				<?php 
        $img = king::get_featured_image($post);
        echo '<img src="' . king_createLinkImage($img, '220x220xtc') . '" alt="" />';
        ?>
				</a>
				<div class="date"><a href="#"><?php 
        echo get_the_date('d F, Y');
        ?>
</a></div>
		        <h5 class="caps" title="<?php 
        echo esc_attr($post->post_title);
        ?>
"><?php 
        echo wp_trim_words($post->post_title, 3);
        ?>
</h5>
		        <p><?php 
        echo wp_trim_words($post->post_content, 12);
コード例 #7
0
			<div class="one_third <?php 
        if ($i == 3) {
            echo 'last';
        }
        ?>
 animated eff-fadeInUp delay-<?php 
        echo $i;
        ?>
00ms">
				<a class="king-post-thumbnail" href="<?php 
        the_permalink();
        ?>
">
				<?php 
        $img = king::get_featured_image($post);
        echo '<img src="' . king_createLinkImage($img, '359x220xc') . '" alt="" class="rimg" />';
        ?>
				</a>
		        <span class="bdate"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_time('M <\\s\\t\\r\\o\\n\\g>d</\\s\\t\\r\\o\\n\\g> Y');
        ?>
</a></span>
			    <h4 title="<?php 
        echo esc_attr($post->post_title);
        ?>
">
			    	<a href="<?php 
        the_permalink();
コード例 #8
0
        ?>
	
		<div class="<?php 
        echo esc_attr($class);
        if ($i % 3 == 0) {
            echo ' last';
        }
        ?>
 animated eff-fadeInUp delay-<?php 
        echo $i;
        ?>
00ms">
			
			<?php 
        $img = king::get_featured_image($post);
        echo '<img src="' . king_createLinkImage($img, $w . 'x250xc') . '" alt="" class="rimg" />';
        ?>
			
			<div class="bcont">
    	
				<h6><?php 
        print $categories;
        ?>
</h6>
				<h4><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h4>
コード例 #9
0
ファイル: king.ajax.php プロジェクト: pivotlearning/wpsite
function king_ajax_loadPostsTimeline($index = 0)
{
    global $king, $wpdb;
    if (!empty($_REQUEST['index'])) {
        $index = $_REQUEST['index'];
    }
    $limit = get_option('posts_per_page');
    $cates = '';
    if (empty($king->cfg['timeline_categories'])) {
        $king->cfg['timeline_categories'] = '';
    } else {
        if ($king->cfg['timeline_categories'][0] == 'default') {
            $king->cfg['timeline_categories'] = '';
        }
    }
    if (is_array($king->cfg['timeline_categories'])) {
        $cates = implode(',', $king->cfg['timeline_categories']);
    }
    $cfg = array('post_type' => 'post', 'category' => $cates, 'posts_per_page' => $limit, 'offset' => $index, 'post_status' => 'publish', 'orderby' => 'post_date', 'order' => 'DESC');
    $posts = get_posts($cfg);
    $cfg['offset'] = 0;
    $cfg['posts_per_page'] = 1000;
    $total = count(get_posts($cfg));
    if (count($posts) >= 1 && is_array($posts)) {
        $i = 0;
        foreach ($posts as $post) {
            $img = esc_url(king_createLinkImage($king->get_featured_image($post, true), '120x120xc'));
            ?>
		
		<div class="cd-timeline-block animated fadeInUp">
			<div class="cd-timeline-img cd-picture animated eff-bounceIn delay-200ms">
				<img src="<?php 
            echo esc_url($img);
            ?>
" alt=""> 
			</div>
			
			<div class="cd-timeline-content animated eff-<?php 
            if ($i % 2 != 0) {
                echo 'fadeInRight';
            } else {
                echo 'fadeInLeft';
            }
            ?>
 delay-100ms">
				<a href="<?php 
            echo get_the_permalink($post->ID);
            ?>
"><h2><?php 
            echo esc_html($post->post_title);
            ?>
</h2></a>
				<p class="text"><?php 
            echo substr($post->post_content, 0, 150);
            ?>
...</p>
				<a href="<?php 
            echo get_the_permalink($post->ID);
            ?>
" class="cd-read-more">Read more</a> 
				<span class="cd-date">
					<?php 
            $date = esc_html(get_the_date('M d Y', $post->ID));
            if ($i % 2 == 0) {
                echo '<strong>' . $date . '</strong>';
            } else {
                echo '<b>' . $date . '</b>';
            }
            ?>
				</span> 
			</div>
		</div>
		
		<?php 
            $i++;
        }
    }
    if ($index + $limit < $total) {
        echo '<a href="#" onclick="timelineLoadmore(' . ($index + $limit) . ', this)" class="btn btn-info aligncenter" style="margin-bottom: -110px;">Load more <i class="fa fa-angle-double-down"></i></a>';
    }
    if (!empty($_REQUEST['index'])) {
        exit;
    }
}
コード例 #10
0
ファイル: post-related.php プロジェクト: pivotlearning/wpsite
				<?php 
        while ($related_query->have_posts()) {
            $related_query->the_post();
            ?>
				<div class="related-item col-md-4">
					<ul class="recent_posts_list">
						<li>
							<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permalink to %s', KING_DOMAIN), the_title_attribute('echo=0'));
            ?>
" rel="bookmark">
								<img src="<?php 
            echo king_createLinkImage($king->get_featured_image($post, false), '272x124xc');
            ?>
" alt="<?php 
            the_title();
            ?>
" />
								<span class="overlay-icon"></span>
							</a>
							<br />
							<a class="relate-link" href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permalink to %s', KING_DOMAIN), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
コード例 #11
0
ファイル: register.php プロジェクト: pivotlearning/wpsite
 public static function king_posts($atts = null, $content = null)
 {
     global $king;
     $atts = shortcode_atts(array('items' => 20, 'category' => '', 'per_row' => 4, 'class' => '', 'cl_class' => '', 'words' => 20, 'img_size' => '245x245', 'format' => '', 'post_type' => 'post', 'taxonomy' => 'category', 'order' => 'DESC'), $atts, 'faq');
     $atts['format'] = rawurldecode($king->ext['bd'](strip_tags($atts['format'])));
     $posts = self::get_posts($atts);
     if (!count($posts)) {
         return '<h4>' . __('Article not found', KING_DOMAIN) . '</h4> <a href="' . admin_url('post-new.php') . '"><i class="fa fa-plus"></i> Add New Article</a>';
     }
     $eff = rand(0, 10);
     if ($eff <= 2) {
         $eff = 'eff-fadeInUp';
     } else {
         if ($eff > 2 && $eff <= 4) {
             $eff = 'eff-fadeInRight';
         } else {
             if ($eff > 4 && $eff <= 8) {
                 $eff = 'eff-fadeInLeft';
             } else {
                 $eff = 'eff-flipInY';
             }
         }
     }
     $columns = array('1' => 'one_full', '2' => 'one_half', '3' => 'one_third', '4' => 'one_fourth', '5' => 'one_fifth');
     $_return = '';
     if (!empty($atts['class'])) {
         $_return = '<div class="' . esc_attr($atts['class']) . '">';
     }
     $i = 1;
     foreach ($posts as $post) {
         $title = esc_html($post->post_title);
         $des = esc_html(wp_trim_words($post->post_content, $atts['words']));
         $img_size = explode('x', $atts['img_size']);
         $_w = intval(!empty($img_size[0]) ? $img_size[0] : 245);
         $_h = intval(!empty($img_size[1]) ? $img_size[1] : 245);
         $_a = !empty($img_size[2]) ? esc_attr($img_size[2]) : 'c';
         $categories_list = get_the_category_list(__(', ', KING_DOMAIN), '', $post->ID);
         $categories = explode(',', $categories_list);
         if (count($categories) == 1) {
             $categories = $categories_list;
         } else {
             if (count($categories) > 1) {
                 $categories_list = '';
                 foreach ($categories as $categorie) {
                     if (strpos($categorie, 'Uncategorized') === false) {
                         $categories_list .= $categorie . ', ';
                     }
                 }
                 $categories_list .= '.';
                 $categories = str_replace(', .', '', $categories_list);
             } else {
                 $categories = $categories_list;
             }
         }
         $img = king_createLinkImage(king::get_featured_image($post), $_w . 'x' . $_h . 'x' . $_a);
         $link = get_permalink($post->ID);
         $_return .= '<div class="animated delay-' . $i . '00ms ' . $eff;
         if ($i % $atts['per_row'] == 0) {
             $_return .= ' last ';
         }
         if (empty($atts['cl_class'])) {
             $_return .= ' ' . esc_attr($columns[$atts['per_row']]);
         } else {
             $_return .= ' ' . $atts['cl_class'];
         }
         $_return .= '">';
         $_return .= str_replace(array('{title}', '{img}', '{des}', '{link}', '{category}'), array($title, $img, $des, $link, $categories), $atts['format']);
         $_return .= '</div>';
         $i++;
     }
     if (!empty($atts['class'])) {
         $_return .= '</div>';
     }
     return do_shortcode($_return);
 }