Пример #1
0
    /**
     * Prints HTML with meta information for the categories, tags and comments.
     */
    function blank_theme_entry_footer()
    {
        $posted_on = blank_theme_posted_on();
        $allowed_meta = get_theme_mod('blank_theme_manage_meta', array('author', 'date', 'comment'));
        $byline = sprintf(esc_html_x('%s', 'post author', 'blank-theme'), '<span class="author vcard">
			<a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a>
		 </span>');
        $cat_links = false;
        $tags_list = false;
        // Hide category and tag text for pages.
        if ('post' == get_post_type()) {
            /* translators: used between list items, there is a space after the comma */
            $categories_list = get_the_category_list(esc_html__(', ', 'blank-theme'));
            if ($categories_list && blank_theme_categorized_blog()) {
                $cat_links = sprintf(esc_html__('%1$s', 'blank-theme'), $categories_list);
                // WPCS: XSS OK.
            }
            /* translators: used between list items, there is a space after the comma */
            $tags_list = get_the_tag_list('<ul class="blank-theme-tags"><li>', '</li><li>', '</li></ul>');
        }
        if (in_array('author', $allowed_meta)) {
            echo "<span class='byline blank-theme-meta-item blank-theme-icon-user'>{$byline}</span>";
        }
        if (in_array('date', $allowed_meta)) {
            echo "<span class='posted-on blank-theme-meta-item blank-theme-icon-calendar'>{$posted_on}</span>";
        }
        if ($cat_links && in_array('categories', $allowed_meta)) {
            echo "<span class='cat-links blank-theme-meta-item blank-theme-icon-category'>{$cat_links}</span>";
        }
        if ($tags_list && in_array('tags', $allowed_meta)) {
            echo "<span class='tag-links blank-theme-meta-item blank-theme-icon-tags'>{$tags_list}</span>";
        }
        if (!is_single() && !post_password_required() && (comments_open() || get_comments_number()) && in_array('comment', $allowed_meta)) {
            echo '<span class="comments-link blank-theme-meta-item blank-theme-icon-comment">';
            comments_popup_link(esc_html__('Leave a comment', 'blank-theme'), esc_html__('Comment (1)', 'blank-theme'), esc_html__('Comments (%)', 'blank-theme'));
            echo '</span>';
        }
        edit_post_link(esc_html__('Edit', 'blank-theme'), '<i class="edit-link">', '</i>');
    }
Пример #2
0
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
	<header class="entry-header">
		<?php 
the_title('<h1 class="entry-title">', '</h1>');
?>

		<div class="entry-meta">
			<?php 
blank_theme_posted_on();
?>
		</div><!-- .entry-meta -->
	</header><!-- .entry-header -->

	<div class="entry-content clearfix">
		<?php 
the_content();
?>
		<?php 
wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', 'blank-theme'), 'after' => '</div>'));
?>
	</div><!-- .entry-content -->

	<footer class="entry-footer">
		<?php