WordPress.org

Forums

Openstrap
[resolved] Remove Post By Author (4 posts)

  1. rtc
    Member
    Posted 1 year ago #

    I love this theme! But I can't figure out how to turn of the by author line on all of my posts. I tried adding these codes in the WordPress Edit CSS:

    .bypostauthor {
    display: none;
    }

    and also tried

    .postmetadata .meta-author {
    display: none;

    If there a way to do this with this theme? Thanks for any help with this!

  2. kaniamea
    Member
    Posted 1 year ago #

    Hello,
    so you would like to remove the "by author" line but keep the date of the post, correct?

    If so, here is what you can do. Create a child theme http://codex.wordpress.org/Child_Themes. Then add content.php and content-single.php to your child theme folder. Open the two files and find this code:

    <?php
    					printf( __( '<span class="post_date"><i class="icon-calendar"></i> %2$s by %3$s', 'openstrap' ),
    					sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a></span>',
    					get_permalink(),
    					esc_attr( get_the_time() ),
    					get_the_date()
    					),
    					sprintf( '<a class="url fn n" href="%1$s" title="%2$s">%3$s</a>',
    					get_author_posts_url( get_the_author_meta( 'ID' ) ),
    					sprintf( esc_attr__( 'View all posts by %s', 'openstrap' ), get_the_author() ),
    					get_the_author()
    					)
    					);
    				?>

    Replace it with:

    <?php the_time(get_option('date_format')); ?>

  3. rtc
    Member
    Posted 1 year ago #

    Thank you so much! It worked like a charm. Whew!

  4. rtc
    Member
    Posted 1 year ago #

    Topic closed.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags