Site logo

Archived topic

WP Show Posts - Meta Data - Post Date - Bigger, Bolder & Above Title?

5 replies · Started by Ian on May 24, 2020

Viewing posts 1–6 of 6

Hello...
First forum post...
Just wondering if it it possible to make the date font bigger, bold and change its location above the title???
Thank you for your help.
Ian

Hi there,

Give this a shot:

.wp-show-posts-entry-meta {
    font-size: 18px;
}

.wp-show-posts-entry-header {
    display: flex;
    flex-direction: column;
}

.wp-show-posts-entry-meta {
    order: -1;
}

That's superb...! thank you!
Please can I ask... sorry, if it is possible to change the colour and remove the link from the date?
I hope this is okay?
Thank you again.
Ian

No problem :)

Color:

.wp-show-posts-meta a, 
.wp-show-posts-meta a:visited {
    color: #000;
}

Removing the link:

add_filter( 'wpsp_date_output', function() {
    $time_string = '<time class="wp-show-posts-entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';

    if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
        $time_string .= '<time class="wp-show-posts-updated" datetime="%3$s" itemprop="dateModified">%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() )
    );

    return sprintf(
        '<span class="wp-show-posts-posted-on wp-show-posts-meta">%s</a></span>',
        $time_string
    );
} );

sorry for the delay in replying and thank you so munch that is excellent!!! Thank you!!!

You're welcome :)

This archived topic is closed to new replies.