[Resolved] Repeated Date

  • Author
    Posts
  • #5706

    skornstein
    Participant

    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?

    #5710

    Andrew Misplon
    Keymaster

    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?

    #5722

    skornstein
    Participant

    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;

    #5724

    Andrew Misplon
    Keymaster

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

    Andrew Misplon
    Keymaster

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

    #5777

    Andrew Misplon
    Keymaster

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

    #5783

    skornstein
    Participant

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

    #5784

    Andrew Misplon
    Keymaster

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

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Scroll to top