Merge branch 'Entry-Meta-Output'

This commit is contained in:
Philip Arthur Moore 2014-09-11 08:45:31 +07:00
commit 097b54dda2
6 changed files with 74 additions and 162 deletions

View File

@ -20,6 +20,7 @@
) ); ) );
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?> <?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->

View File

@ -24,32 +24,6 @@
</div><!-- .entry-summary --> </div><!-- .entry-summary -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?> <?php _s_entry_footer(); ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Posted in %1$s', '_s' ), $categories_list ); ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( $tags_list ) :
?>
<span class="tags-links">
<?php printf( __( 'Tagged %1$s', '_s' ), $tags_list ); ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -24,37 +24,6 @@
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php <?php _s_entry_footer(); ?>
/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', '_s' ) );
/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( ! _s_categorized_blog() ) {
// This blog only has 1 category so we just need to worry about tags in the meta text
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was tagged %2$s. Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', '_s' );
} else {
$meta_text = __( 'Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', '_s' );
}
} else {
// But this blog has loads of categories so we should probably display them here
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', '_s' );
} else {
$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', '_s' );
}
} // end check for categories on this blog
printf(
$meta_text,
$category_list,
$tag_list,
get_permalink()
);
?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -33,32 +33,6 @@
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?> <?php _s_entry_footer(); ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Posted in %1$s', '_s' ), $categories_list ); ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( $tags_list ) :
?>
<span class="tags-links">
<?php printf( __( 'Tagged %1$s', '_s' ), $tags_list ); ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -93,6 +93,36 @@ function _s_posted_on() {
} }
endif; endif;
if ( ! function_exists( '_s_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function _s_entry_footer() {
// 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( __( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) {
printf( '<span class="cat-links">' . __( 'Posted in %1$s', '_s' ) . '</span>', $categories_list );
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( $tags_list ) {
printf( '<span class="tags-links">' . __( 'Tagged %1$s', '_s' ) . '</span>', $tags_list );
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) );
echo '</span>';
}
edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' );
}
endif;
/** /**
* Returns true if a blog has more than 1 category. * Returns true if a blog has more than 1 category.
* *

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: _s 1.0-wpcom\n" "Project-Id-Version: _s 1.0-wpcom\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tags/_s\n" "Report-Msgid-Bugs-To: http://wordpress.org/tags/_s\n"
"POT-Creation-Date: 2014-06-03 14:02:16+00:00\n" "POT-Creation-Date: 2014-09-11 00:43:48+00:00\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -17,9 +17,7 @@ msgid "Oops! That page can&rsquo;t be found."
msgstr "" msgstr ""
#: 404.php:19 #: 404.php:19
msgid "" msgid "It looks like nothing was found at this location. Maybe try one of the links below or a search?"
"It looks like nothing was found at this location. Maybe try one of the links "
"below or a search?"
msgstr "" msgstr ""
#: 404.php:27 #: 404.php:27
@ -27,6 +25,7 @@ msgid "Most Used Categories"
msgstr "" msgstr ""
#. translators: %1$s: smiley #. translators: %1$s: smiley
#: 404.php:44 #: 404.php:44
msgid "Try looking in the monthly archives. %1$s" msgid "Try looking in the monthly archives. %1$s"
msgstr "" msgstr ""
@ -93,7 +92,7 @@ msgstr ""
msgid "Chats" msgid "Chats"
msgstr "" msgstr ""
#: archive.php:66 sidebar.php:16 #: archive.php:66
msgid "Archives" msgid "Archives"
msgstr "" msgstr ""
@ -125,81 +124,29 @@ msgid "Nothing Found"
msgstr "" msgstr ""
#: content-none.php:19 #: content-none.php:19
msgid "" msgid "Ready to publish your first post? <a href=\"%1$s\">Get started here</a>."
"Ready to publish your first post? <a href=\"%1$s\">Get started here</a>."
msgstr "" msgstr ""
#: content-none.php:23 #: content-none.php:23
msgid "" msgid "Sorry, but nothing matched your search terms. Please try again with some different keywords."
"Sorry, but nothing matched your search terms. Please try again with some "
"different keywords."
msgstr "" msgstr ""
#: content-none.php:28 #: content-none.php:28
msgid "" msgid "It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help."
"It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps "
"searching can help."
msgstr "" msgstr ""
#: content-page.php:18 content-single.php:20 content.php:27 #: content-page.php:18 content-single.php:20 content.php:22
msgid "Pages:" msgid "Pages:"
msgstr "" msgstr ""
#: content-page.php:24 content-single.php:60 content.php:61 #: content-page.php:25 inc/template-tags.php:122
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#. translators: used between list items, there is a space after the comma #: content.php:19
#: content-single.php:29 content-single.php:32 content.php:38 content.php:48
msgid ", "
msgstr ""
#: content-single.php:37
msgid ""
"This entry was tagged %2$s. Bookmark the <a href=\"%3$s\" rel=\"bookmark"
"\">permalink</a>."
msgstr ""
#: content-single.php:39
msgid "Bookmark the <a href=\"%3$s\" rel=\"bookmark\">permalink</a>."
msgstr ""
#: content-single.php:45
msgid ""
"This entry was posted in %1$s and tagged %2$s. Bookmark the <a href=\"%3$s\" "
"rel=\"bookmark\">permalink</a>."
msgstr ""
#: content-single.php:47
msgid ""
"This entry was posted in %1$s. Bookmark the <a href=\"%3$s\" rel=\"bookmark"
"\">permalink</a>."
msgstr ""
#: content.php:24
msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>" msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
msgstr "" msgstr ""
#: content.php:42
msgid "Posted in %1$s"
msgstr ""
#: content.php:52
msgid "Tagged %1$s"
msgstr ""
#: content.php:58
msgid "Leave a comment"
msgstr ""
#: content.php:58
msgid "1 Comment"
msgstr ""
#: content.php:58
msgid "% Comments"
msgstr ""
#: footer.php:15 #: footer.php:15
msgid "http://wordpress.org/" msgid "http://wordpress.org/"
msgstr "" msgstr ""
@ -246,12 +193,12 @@ msgstr ""
#: inc/template-tags.php:55 #: inc/template-tags.php:55
msgctxt "Previous post link" msgctxt "Previous post link"
msgid "<span class=\"meta-nav\">&larr;</span> %title" msgid "<span class=\"meta-nav\">&larr;</span>&nbsp;%title"
msgstr "" msgstr ""
#: inc/template-tags.php:56 #: inc/template-tags.php:56
msgctxt "Next post link" msgctxt "Next post link"
msgid "%title <span class=\"meta-nav\">&rarr;</span>" msgid "%title&nbsp;<span class=\"meta-nav\">&rarr;</span>"
msgstr "" msgstr ""
#: inc/template-tags.php:82 #: inc/template-tags.php:82
@ -264,14 +211,35 @@ msgctxt "post author"
msgid "by %s" msgid "by %s"
msgstr "" msgstr ""
#. translators: used between list items, there is a space after the comma
#: inc/template-tags.php:104 inc/template-tags.php:110
msgid ", "
msgstr ""
#: inc/template-tags.php:106
msgid "Posted in %1$s"
msgstr ""
#: inc/template-tags.php:112
msgid "Tagged %1$s"
msgstr ""
#: inc/template-tags.php:118
msgid "Leave a comment"
msgstr ""
#: inc/template-tags.php:118
msgid "1 Comment"
msgstr ""
#: inc/template-tags.php:118
msgid "% Comments"
msgstr ""
#: search.php:16 #: search.php:16
msgid "Search Results for: %s" msgid "Search Results for: %s"
msgstr "" msgstr ""
#: sidebar.php:23
msgid "Meta"
msgstr ""
#. Theme Name of the plugin/theme #. Theme Name of the plugin/theme
msgid "_s" msgid "_s"
msgstr "" msgstr ""
@ -281,11 +249,7 @@ msgid "http://underscores.me/"
msgstr "" msgstr ""
#. Description of the plugin/theme #. Description of the plugin/theme
msgid "" msgid "Hi. I'm a starter theme called <code>_s</code>, or <em>underscores</em>, if you like. I'm a theme meant for hacking so don't use me as a <em>Parent Theme</em>. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for."
"Hi. I'm a starter theme called <code>_s</code>, or <em>underscores</em>, if "
"you like. I'm a theme meant for hacking so don't use me as a <em>Parent "
"Theme</em>. Instead try turning me into the next, most awesome, WordPress "
"theme out there. That's what I'm here for."
msgstr "" msgstr ""
#. Author of the plugin/theme #. Author of the plugin/theme