Home>Support>Vantage Theme issue + Fix

Vantage Theme issue + Fix

By JLMoss, 9 years ago. Last reply by Alex S, 9 years ago.
Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

When comments are disabled this function in .vantage/inc/template.tags.php still outputs ‘ | leave a comment’ in the meta info which is not disirable:

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 = '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><time class="updated" datetime="%5$s">%6$s</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('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
		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()
	);

        $comments_link = '<span class="comments-link"><a href="' . get_comments_link() . '">' . get_comments_number_text( 'Leave a comment' ) . '</a></span>';        
        $posted_on_parts = array(
        	'on' => sprintf( __( 'Posted on %s', 'vantage'), $date_time ),
        	'by' => sprintf( __( '<span class="byline"> by %s</span>', 'vantage' ), $author),
        	'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;

A working fix:

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 = '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><time class="updated" datetime="%5$s">%6$s</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('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
		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
    if( comments_open( get_the_ID())){
        $comments_link = '<span class="comments-link"><a href="' . get_comments_link() . '">' . get_comments_number_text( 'Leave a comment' ) . '</a></span>';        
        $posted_on_parts = array(
        	'on' => sprintf( __( 'Posted on %s', 'vantage'), $date_time ),
        	'by' => sprintf( __( '<span class="byline"> by %s</span>', 'vantage' ), $author),
        	'with' => ' | ' . $comments_link
        );         
    } else {
        $posted_on_parts = array(
        	'on' => sprintf( __( 'Posted on %s', 'vantage'), $date_time ),
        	'by' => sprintf( __( '<span class="byline"> by %s</span>', 'vantage' ), $author)
        );         
    }

	$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;

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 4 months ago Alex S
    Hi, I Work Here

    Hi James,

    Thank you for reporting this issue. We should hopefully have a fix for this in the next version.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More