コード例 #1
0
ファイル: template-tags.php プロジェクト: Greg36/Gently
 /**
  * Displays meta information for the current post - post-date/time, author and comments count.
  *
  * @param string $location Where will be displayed.
  */
 function gently_posted_on($location = '')
 {
     $time_string = gently_entry_time();
     $author_avatar = get_avatar(get_the_author_meta('ID'), '35');
     $posted_on = '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>';
     $byline = '<span class="author vcard">' . $author_avatar . '<a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>';
     $comments_count = gently_comments_count();
     if ($location === 'search') {
         echo '<span class="posted-on">' . $posted_on . '</span>' . '<span class="byline"> ' . gently_get_author() . '</span>';
     } else {
         if ($location === 'archive') {
             echo '<span class="byline"> ' . gently_get_author() . '</span>' . '<span class="posted-on">' . $posted_on . '</span>';
         } else {
             echo '<span class="byline"> ' . $byline . '<br></span><span class="posted-on">' . $posted_on . '</span>' . $comments_count;
         }
     }
 }
コード例 #2
0
ファイル: post-related.php プロジェクト: Greg36/Gently
 * @package Gently
 */
?>

<div class="row collapse">

	<?php 
/* Add columns only if there is a featured image to display. */
if (has_post_thumbnail()) {
    ?>
	<div class="small-12 medium-3 columns related-post-img">
		<?php 
    gently_featured_image(true);
    ?>
	</div>

	<div class="small-12 medium-9 columns">
	<?php 
}
?>

	<?php 
gently_entry_time();
gently_comments_count();
the_title(sprintf('<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h3>');
echo '<p>' . wp_trim_words(get_the_excerpt(), 27) . '</p>';
if (has_post_thumbnail()) {
    echo '</div>';
}
?>
</div>
コード例 #3
0
ファイル: content-archive.php プロジェクト: Greg36/Gently
the_ID();
?>
" <?php 
post_class();
?>
>
	<header class="entry-header">

		<?php 
if ('post' == get_post_type()) {
    ?>

			<div class="entry-meta">
				<?php 
    if (is_author()) {
        echo '<span class="posted-on"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . gently_entry_time() . '</a></span>' . gently_list_categories();
    } else {
        gently_posted_on('archive');
    }
    ?>
			</div><!-- .entry-meta -->

		<?php 
}
?>

		<?php 
the_title(sprintf('<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>');
?>

	</header>