コード例 #1
0
ファイル: gifs.php プロジェクト: nathansh/gifzone
<?php

$the_query = new WP_Query(array('post_type' => 'gif', 'posts_per_page' => -1));
if ($the_query->have_posts()) {
    include "gif-filters.php";
    echo '<ul class="gif-list">';
    while ($the_query->have_posts()) {
        $the_query->the_post();
        echo '<li class="gif-list__item">';
        echo '<div class="gif-tile editable">';
        $gif = get_field('gif_image')['url'];
        $tags = wp_get_post_tags($post->ID);
        // Gif with link
        echo '<a href="' . $gif . '" class="gif-tile__link">';
        // Image
        d7_acf_image('gif_image', 'thumbnail', 'gif-tile__image');
        // hashtags
        if (count($tags)) {
            echo '<ul class="gif-tile__tags">';
            foreach ($tags as $index => $tag) {
                echo '<li class="gif-tile__tag">#';
                echo $tag->name;
                if ($count + 1 < count($tags)) {
                    echo ', ';
                }
                echo '</li>';
            }
            echo '</ul>';
        }
        echo '</a>';
        edit_post_link();
コード例 #2
0
?>

		<div class="showcase__description">
			<?php 
the_content();
?>
		</div>

	</header>

	<div class="showcase__images">

		<?php 
$images = get_field('design_images');
foreach ($images as $image) {
    $class = 'showcase__image-actual';
    if ($image['design_image_border']) {
        $class .= ' showcase__image-actual--border';
    }
    echo '<figure class="showcase__image">';
    d7_acf_image($image['design_image'], 'portfolio-full', $class);
    echo '</figure>';
}
?>

	</div>

</article><!-- #post-## -->

<?php 
// comments_template();
コード例 #3
0
					</div>
				<?php 
}
?>

				<!-- Work grid -->
				<?php 
if (have_posts()) {
    echo '<ul class="grid-list">';
    // Start the Loop.
    while (have_posts()) {
        the_post();
        if ($images = get_field('design_images')) {
            echo '<li class="grid-list__item editable">';
            echo '<a class="grid-list__link" href="' . get_permalink() . '">';
            d7_acf_image($images[0]['design_image'], 'small-square', 'grid-list__image');
            echo '</a>';
            $edit = get_edit_post_link();
            if ($edit) {
                echo '<a href="' . $edit . '" class="editable__link">Edit</a>';
            }
            echo '</li>';
        }
    }
    echo '</ul>';
    // Pagination
    get_template_part('partials/pagination');
} else {
    // If no content, include the "No posts found" template.
    get_template_part('partials/content', 'none');
}