Resolved

Date posted

Puro Theme started by skornstein Apr 6, 2017 18 replies
skornstein Apr 6, 2017 · 9:47 pm #6215

Hello — I just realized that when I publish a new post and and post date is today, it doesn’t show a date in the byline? Could you share a fix?

http://www.somethingsbrewing.com

Thanks!

Sam

Andrew Misplon Puro Apr 6, 2017 · 9:53 pm #6217

Hey Sam

I need to perhaps relook at the customization we did for you. Please, remind me, was the original task to remove the icons and change the format to:

Posted on {date} by {author} in {categories} ?

skornstein Apr 8, 2017 · 9:36 pm #6248

Hi Andrew,

The CSS is:

/* 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;
}

And the snippet is:

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;

Thanks!

Andrew Misplon Puro Apr 9, 2017 · 10:21 am #6249

Thanks.

Try changing your CSS as follows:

/* 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;
}
.entry-header .entry-meta .updated {
	display: inline-block;
}
skornstein Apr 9, 2017 · 9:08 pm #6256

It works! Thank you, sir.

Is there an easy to to put the featured image below the post title on the front page when I only show excerpts of posts? If it’s a pain, no worries. But I just switched from full posts to excerpts, and would love to switch the order.

Thanks Andrew!

Andrew Misplon Puro Apr 10, 2017 · 8:15 am #6262

Glad that helped.

Not without getting into the files. We can do it but we’d need to switch the order of the code as it’s loaded. Let me know 🙂

skornstein Apr 10, 2017 · 2:17 pm #6269

If you’re up for it, I am!

Andrew Misplon Puro Apr 10, 2017 · 2:21 pm #6270

So only on archive pages? Not on the single page. Correct?

skornstein Apr 11, 2017 · 2:48 am #6279

Thanks Andrew. It works! However, I wasn’t previously using a child theme, and when I added the child that came with the original puro download, some of the settings from the original changed (e.g., to show excerpts), and many of the widgets disappeared. I could manually change these back, but wasn’t sure if this was indicative of a larger issue with the child theme I set up. Any thoughts?

Andrew Misplon Puro Apr 11, 2017 · 8:27 am #6282

Child theme changes the theme slug so everything resets. Download plugin called Customizer Import/Export plugin, go back to parent, download settings, change to child, import settings.

On my phone so description brief 🙂

skornstein Apr 13, 2017 · 7:37 pm #6291

Thanks Andrew. All fixed now, however, with the child theme, for some strange reason it now shows both the post date and update date side by side like this: Posted on April 10, 2017April 11, 2017 by Sam Kornsteinin General

Any thoughts on an easy fix?

Andrew Misplon Puro Apr 13, 2017 · 7:57 pm #6292

Is the Custom CSS I sent being applied to the child theme? Is it still active?

skornstein Apr 13, 2017 · 9:10 pm #6293

Still active, and other customm css insertions are working. It’s strange. Even when I comment out the CSS for byline, it looks the same.

Andrew Misplon Puro Apr 14, 2017 · 5:55 am #6294

Try removing this from Custom CSS:

.entry-header .entry-meta .updated {
    display: inline-block;
}
skornstein Apr 15, 2017 · 6:05 pm #6295

All set. Thanks!

One final question. I’ve added custom CSS to reduce the amount of space between the header and the body, but it looks like there’s spacing above the post titles. Is there a way to eliminate this, so that the tops of the titles are aligned with the top of the first widget, which in my case is a search box?

Best support every by the way.

19 posts