コード例 #1
0
ファイル: slider.php プロジェクト: joelfriesen/arris
function arrisdesign_slider_template()
{
    $cat = absint(get_theme_mod('slider_cat'));
    if (get_theme_mod('slider_number')) {
        $number = absint(get_theme_mod('slider_number'));
    } else {
        $number = 6;
    }
    $args = array('posts_per_page' => $number, 'cat' => $cat);
    $query = new WP_Query($args);
    if ($query->have_posts()) {
        ?>
		<div class="flexslider loading">
			<ul class="slides">	
				<?php 
        while ($query->have_posts()) {
            $query->the_post();
            ?>
	
					<?php 
            if (has_post_thumbnail()) {
                ?>
	
						<li class="slide">
							<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
"><?php 
                the_post_thumbnail('slider-image');
                ?>
</a>
							<div class="slide-info">
								<?php 
                the_title(sprintf('<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>');
                ?>
								<span class="entry-meta"><?php 
                arrisdesign_posted_on();
                ?>
</span>
							</div>
							<div class="entry-summary">
								<?php 
                echo wp_trim_words(get_the_content(), 30, '[...]');
                ?>
							</div>
						</li>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
	
			</ul>
		</div>
		<?php 
    }
    wp_reset_postdata();
}
コード例 #2
0
ファイル: content.php プロジェクト: joelfriesen/arris
		</div>		
	<?php 
}
?>
	
	<header class="entry-header">
		<?php 
the_title(sprintf('<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>');
?>

		<div class="entry-meta">
		<?php 
if ('post' == get_post_type()) {
    ?>
			<?php 
    arrisdesign_posted_on();
    ?>
			<?php 
    /* translators: used between list items, there is a space after the comma */
    $categories_list = get_the_category_list(__(', ', 'arrisdesign'));
    if ($categories_list && arrisdesign_categorized_blog()) {
        ?>
				<span class="cat-links">
					<?php 
        echo '<i class="fa fa-folder"></i>&nbsp;' . $categories_list;
        ?>
				</span>
			<?php 
    }
    ?>
			<?php