Permalink
Browse files

updating bylines so they are easier to read

Special thanks to @joseluis for this pull request.
  • Loading branch information...
1 parent f4480a6 commit cede2ce03ac8082c2bcb2090b89d56f46acea93d Eddie Machado committed Nov 19, 2014
View
@@ -45,12 +45,17 @@
<article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article">
- <header class="article-header">
+ <header class="entry-header article-header">
<h3 class="h2 entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
- <p class="byline vcard"><?php
- printf(__( 'Posted', 'bonestheme' ) . ' <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> ' . __('by', 'bonestheme' ) . ' <span class="author">%3$s</span> <span class="amp">&</span> ' . __('filed under', 'bonestheme') . ' %4$s.', get_the_time('Y-m-j'), get_the_time(__( 'F jS, Y', 'bonestheme' )), get_the_author_link( get_the_author_meta( 'ID' ) ), get_the_category_list(', '));
- ?></p>
+ <p class="byline entry-meta vcard">
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
+ </p>
</header>
View
@@ -13,8 +13,13 @@
<header class="article-header">
<h1 class="h2 entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
- <p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <p class="byline entry-meta vcard">
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline entry-meta vcard">
- <?php printf( __( 'Posted <time class="updated entry-time" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author entry-author" itemprop="author" itemscope itemptype="http://schema.org/Person">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="name"><?php the_title(); ?></h1>
<p class="byline entry-meta vcard">
- <?php printf( __( 'Posted <time class="updated entry-time" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author entry-author" itemprop="author" itemscope itemptype="http://schema.org/Person">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>
<p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -7,7 +7,12 @@
<h1 class="entry-title single-title" itemprop="name"><?php the_title(); ?></h1>
<p class="byline entry-meta vcard">
- <?php printf( __( 'Posted <time class="updated entry-time" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author entry-author" itemprop="author" itemscope itemptype="http://schema.org/Person">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
</p>
</header> <?php // end article header ?>
@@ -21,7 +21,14 @@
<h1 class="entry-title single-title" itemprop="headline" rel="bookmark"><?php the_title(); ?></h1>
<p class="byline entry-meta vcard">
- <?php printf( __( 'Posted <time class="updated entry-time" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author entry-author" itemprop="author" itemscope itemptype="http://schema.org/Person">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
+
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
+
</p>
</header> <?php // end article header ?>
View
@@ -11,13 +11,18 @@
<article id="post-<?php the_ID(); ?>" <?php post_class('cf'); ?> role="article">
- <header class="article-header">
-
- <h3 class="search-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
-
- <p class="byline vcard">
- <?php printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
- </p>
+ <header class="entry-header article-header">
+
+ <h3 class="search-title entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
+
+ <p class="byline entry-meta vcard">
+ <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
+ /* the time the post was published */
+ '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
+ /* the author of the post */
+ '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
+ ); ?>
+ </p>
</header>

4 comments on commit cede2ce

@mrwigster

This has caused there to be 2 x "By" now, you'll notice if you use the above commit/code you'll have the following on your live site: "by by AUTHOR_NAME".

@joseluis
Contributor

That's right. I see only two possible solutions, since we can't remove the word by from the gettext string without making it untranslatable:

  1. leave the gettext string as Posted %1$s by %2$s and remove <span class="by">by</span> from the the 2nd parameter. This is my personal choice, from the original pull #635, for the reasons exposed there.
  2. Cut <span class="by">by</span> and substitute the word by with it, in the gettext string. I don't really see the need for the tags there anyway, and it makes the translatable string look uglier. That was one of the things we wanted to fix.
@mrwigster

I'd agree with option 1 also. It's currently rather verbose to have it all wrapped int he class and its own separate class (especially a class that is such a small number of characters).

@edent
edent commented on cede2ce Dec 22, 2014

I've attempted a fix for this in #714

Please sign in to comment.