Example #1
0
<div class="link-card-container">
\t<h5>前の記事</h5>
\t{$prev_link_html}
</div>
EOD;
    }
    $next_post = get_next_post(true);
    if (!empty($next_post)) {
        $next_link = new \purely\LinkCard($next_post);
        $next_link_html = $next_link->getCode("article_footer_link", "next-post");
        echo <<<EOD
<div class="link-card-container">
\t<h5>次の記事</h5>
\t{$next_link_html}
</div>
EOD;
    }
    if (empty($prev_post) && empty($next_post)) {
        echo '前後の記事がありませんでした';
    }
    $ad_html = getADCode('scraper');
    echo <<<EOD
</div></div><div class="pure-u-1 pure-u-sm-1-4 pure-u-md-7-24 pure-u-lg-3-8">
\t{$ad_html}
\t<!-- ad -->
\t\t</div>
</footer>
EOD;
} else {
    //シングルではない記事下footer
}
Example #2
0
    }
    echo '</h2>';
} else {
    if (get_the_title()) {
        the_title(sprintf('<h2 class="entry-title" itemprop="name headline"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>');
    } else {
        echo "<!-- no title -->";
        echo '<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '">タイトルのない投稿</a></h2>';
    }
    echo '<h3><span class="published-date"><time datetime="' . get_the_time('Y-m-d\\TH:i:sP') . '" itemprop="datePublished">' . get_post_time('Y年n月j日') . '</time></span></h3>';
}
?>
	</header>
<?php 
if (is_singular()) {
    echo getADCode('banner');
}
if (has_post_thumbnail()) {
    echo '<div class="post-thumbnail-container">';
    $post_thumb = wp_get_attachment_metadata(get_post_thumbnail_id($post->ID));
    $upload_dir = wp_upload_dir();
    $attachment = get_post(get_post_thumbnail_id($post->ID));
    //echo '<img src="' . esc_url($upload_dir["baseurl"] . '/' . $post_thumb["file"]) . '" alt="' . esc_attr($attachment->post_excerpt) . '" width="' . esc_attr($post_thumb["width"]) . '" height="' . esc_attr($post_thumb["height"]) . '" class="attachment-post-thumbnail wp-post-image">';
    //the_post_thumbnail();
    $image_url = $upload_dir["baseurl"] . '/' . $post_thumb["file"];
    $image_width = $post_thumb["width"];
    $image_alt = $attachment->post_excerpt;
    $image_attr = 'sizes="(max-width: 48em) 100vw, (max-width:950px) calc(100vw - 150px),800px" class="attachment-post-thumbnail wp-post-image" itemprop="image"';
    echo purelyPostThumbnail($image_url, $image_width, $image_alt, $image_attr);
    echo '</div>';
}