WordPress.org

Forums

Clean Black
[resolved] How to hide author and date from post. (5 posts)

  1. Mecanito
    Member
    Posted 7 months ago #

    Hi, I want to hide this text: Written by example on August 18, 2014, from posts. Any idea?

  2. Hey there,

    You would either need to edit the code directly to remove the PHP or you could hide it with some CSS:

    .dateview{display:none;}

    There is a parent container with a class of mediumfont but this is also used on the 404 page so I didn't target it.

    If you wish to create a child theme and remove the PHP so it doesn't load at all then there are 3 files:

    content-single.php

    <?php if(is_single()) { ?>
      <div class="mediumfont">
      <div class="dateview">
      Written by <a rel="author" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author() ?></a>
    	&nbsp;on&nbsp;<?php the_time('F j, Y'); ?>&nbsp;<?php edit_post_link( __( 'Edit', 'cleanblack' ), '<span class="edit-link">(', ')</span>' ); ?></div></div><div style="clear:both;"></div><?php } ?>

    image.php

    <div class="mediumfont"><div class="dateview">Uploaded by <a rel="author" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author() ?></a>
    	&nbsp;<?php edit_post_link( __( 'Edit', 'cleanblack' ), '<span class="edit-link">', '</span>' ); ?></div></div><div style="clear:both;"></div>

    loop.php

    <div class="mediumfont"><div class="dateview">Written by <a rel="author" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author() ?></a>&nbsp;on&nbsp;<?php the_time('F j, Y'); ?></div><div style="clear:both;"></div></div>

    Hope this helps.

    Take care.

  3. Mecanito
    Member
    Posted 7 months ago #

    I created a child theme, about those three files: what do I do? delete them? sorry I'm new at this!.

  4. Mecanito
    Member
    Posted 7 months ago #

    I did it! removed the three files and worked! thank you for your awesome support.

  5. That's excellent, I'm glad you got this. :)

    Have a great weekend! :)

Reply

You must log in to post.

About this Theme

About this Topic