Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter Mecanito

    (@mecanito)

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

    Thread Starter Mecanito

    (@mecanito)

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

    That’s excellent, I’m glad you got this. ??

    Have a great weekend! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to hide author and date from post.’ is closed to new replies.