Resolved

Repeated Date

Puro Theme started by skornstein Jan 2, 2017 7 replies
skornstein Jan 2, 2017 · 6:47 pm #5706

Sorry to keep bugging you. One more question, I think this one is easy. For some reason, the date now repeats on the main page: http://www.somethingsbrewing.com. It does not do this on individual posts. Any ideas? I suspect it’s showing both the post date and update date?

Andrew Misplon Puro Jan 2, 2017 · 7:06 pm #5710

No problem at all.

If you remove the following from Custom CSS the problem will be fixed:

#main .entry-header .entry-meta .updated {
    display: inline-block;
}

Does that break anything else we’ve done?

skornstein Jan 3, 2017 · 8:18 pm #5722

Hi Andrew — thanks for the quick response again. Did not seem to work. Oddly, the author name is now missing on the mobile version as well. Interestingly, the date is not repeated in Chrome incognito mode or in IE, but is in normal Chrome and Edge. I’ve tried disabling all plugins, clearing cache, etc, which did not help. Any help would be appreciated!

Just as a recap, here’s the code in Custom CSS:

/* CSS for Byline */

.entry-header .entry-meta span {
display: inline-block;
margin-right: 5px;
}
.entry-header .entry-meta span:before, .entry-header .entry-meta a:before {
content: none !important;
}
.single .entry-header .entry-meta .entry-date:before {
content: none;
}
.single #main .entry-header .entry-meta .updated {
display: none;
}

/* CSS for Hover Color Change */

#page .entry-title a:hover {
color: #4e7cd8
}

/* Mobile Logo */
@media (max-width: 768px) {
.site-header .site-branding {
max-width: 95%;
}
}

/* Mobile Menu Icon */
.responsive-menu .menu-toggle {
top: 11px;
}

And here’s the Snippet:

if ( ! function_exists( ‘puro_posted_on’ ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function puro_posted_on() {
$time_string = ‘<time class=”entry-date published updated” datetime=”%1$s”>%2$s</time>’;
if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {
$time_string = ‘<time class=”entry-date published” datetime=”%1$s”>%2$s</time><time class=”updated” datetime=”%3$s”>%4$s</time>’;
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
esc_html_x( ‘Posted on %s’, ‘post date’, ‘puro’ ),
‘ . $time_string . ‘
);
$byline = sprintf(
esc_html_x( ‘by %s’, ‘post author’, ‘puro’ ),
‘<span class=”author vcard”>‘ . esc_html( get_the_author() ) . ‘</span>’
);
$cats = sprintf(
esc_html_x( ‘in %s’, ‘categories in’, ‘puro’ ),
get_the_category_list( __( ‘, ‘, ‘puro’ ) )
);
echo ‘<span class=”posted-on”>’ . $posted_on . ‘</span><span class=”byline”> ‘ . $byline . ‘</span><span class=”cat-links”>’. $cats .'</span>’; // WPCS: XSS OK.
}
endif;

Andrew Misplon Puro Jan 3, 2017 · 8:27 pm #5724

For the mobile issue, try adding:

@media (max-width: 30rem) {
	.resp .entry-header .entry-meta .author,
	.resp .entry-header .entry-meta .cat-links,
	.resp .entry-header .entry-meta .tags-links,
	.resp .entry-header .entry-meta .comments-link,
	.resp .entry-header .entry-meta .edit-link {
		display: inline-block;
	}
}
Andrew Misplon Puro Jan 3, 2017 · 8:30 pm #5725

All seems normal for me now with regards to the repeated date in Chrome, FF and Safari. Any change on your side?

Andrew Misplon Puro Jan 18, 2017 · 1:16 am #5777

Hi 🙂 Quick follow-up to see how things are looking on your side. Thanks.

skornstein Jan 18, 2017 · 11:46 pm #5783

Apologies for not following up. It worked perfectly. Thanks again. Love the theme.

Andrew Misplon Puro Jan 18, 2017 · 11:58 pm #5784

Awesome 🙂 Really glad to hear the problem resolved. Chat soon, cheers 🙂

8 posts