[Resolved] Date posted

  • Author
    Posts
  • #6215

    skornstein
    Participant

    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

    #6217

    Andrew Misplon
    Keymaster

    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} ?

    #6248

    skornstein
    Participant

    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!

    #6249

    Andrew Misplon
    Keymaster

    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;
    }
    #6256

    skornstein
    Participant

    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!

    #6262

    Andrew Misplon
    Keymaster

    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 🙂

    #6269

    skornstein
    Participant

    If you’re up for it, I am!

    #6270

    Andrew Misplon
    Keymaster

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

    #6272

    Andrew Misplon
    Keymaster

    If so then add this file to your child theme:

    https://purothemes.com/wp-content/uploads/2017/04/content.php_.zip

    Unzip first.

    #6279

    skornstein
    Participant

    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?

    #6282

    Andrew Misplon
    Keymaster

    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 🙂

    #6291

    skornstein
    Participant

    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?

    #6292

    Andrew Misplon
    Keymaster

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

    #6293

    skornstein
    Participant

    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.

    #6294

    Andrew Misplon
    Keymaster

    Try removing this from Custom CSS:

    .entry-header .entry-meta .updated {
        display: inline-block;
    }
Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.

Scroll to top