• I am using the Surfarama theme layout for my new website.
    I would like to remove all author, date, and comments from showing on posts. I have turned comments off under settings/discussion but they still shows on all posts.

    Please reply. Thank you for your time!

Viewing 1 replies (of 1 total)
  • Not sure if you still need this, but it might help someone?

    Remove the following code from ‘content-single.php’
    <div class=”entry-meta clearfix”>
    <?php
    //first get the current category ID
    $categories = get_the_category($post->ID);
    $cat_id = $categories[0]->cat_ID;
    //then i get the data from the database
    $cat_data = get_option(“taxonomy_$cat_id”);
    //and then i just display my category image if it exists
    if (isset($cat_data[‘cat_color’])){
    $cat_color_write = ‘ style=”background-color: ‘. $cat_data[‘cat_color’] .'”‘;
    } else {
    $cat_color_write = ”;
    }
    printf( __( ‘<span class=”sep meta-by”%8$s>Author </span> <span class=”author vcard”>%7$s</span><span class=”byline”> <span class=”sep meta-on”%8$s> Date </span> <time class=”entry-date” datetime=”%3$s”>%4$s</time></span>’, ‘surfarama’ ),
    esc_url( get_permalink() ),
    esc_attr( get_the_time() ),
    esc_attr( get_the_date( ‘c’ ) ),
    esc_html( get_the_date() ),
    esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
    esc_attr( sprintf( __( ‘View all posts by %s’, ‘surfarama’ ), get_the_author() ) ),
    esc_html( get_the_author() ),
    $cat_color_write
    );
    ?>
    <?php if ( comments_open() || ( ‘0’ != get_comments_number() && ! comments_open() ) ) : ?>
    <div class=”comment-top”><span class=”meta-com”<?php echo $cat_color_write; ?>><?php _e(‘Comments:’, ‘surfarama’); ?></span> <?php comments_popup_link( __( ‘Leave a comment’, ‘surfarama’ ), __( ‘1 Comment’, ‘surfarama’ ), __( ‘% Comments’, ‘surfarama’ ) ); ?></div>
    <?php endif; ?>
    </div>

Viewing 1 replies (of 1 total)
  • The topic ‘author, date and comments on posts’ is closed to new replies.