Site Origin Vantage Tweak

There’s a small issue in the theme where when comments are not enabled for a post it still shows text to leave a comment..

A quick fix

  • Find file: ./vantage/inc/template-tags.php
  • Find Function:¬†function vantage_posted_on()
  • Replace that function with the code below

if ( ! function_exists( 'vantage_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*
* @since vantage 1.0
*/
function vantage_posted_on() {
$date_time = '';
$date_time = sprintf( $date_time,
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
apply_filters('vantage_post_on_date', esc_html( get_the_date() )),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$author = sprintf('',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'vantage' ), get_the_author() ) ),
get_the_author()
);
// Edited this
$posted_on_parts = array(
'on' => sprintf( __( 'Posted on %s', 'vantage'), $date_time ),
'by' => sprintf( __( '', 'vantage' ), $author),
'with' => ''
);
if( comments_open( ) && get_option( 'thread_comments' ) ) {
$comments_link = ' | ' . get_comments_number_text( 'Leave a comment' ) . '';
$posted_on_parts['with'] = $comments_link;
}
$posted_on_parts = apply_filters( 'vantage_post_on_parts', $posted_on_parts );
$posted_on = implode(' ', $posted_on_parts);
echo apply_filters('vantage_posted_on', $posted_on);
}
endif;