Remove Author Link from Blog Post

My Author name is displaying on my post which is good, but i don’t want any link on the Author name…

Website Address: http://issan.org.ng/
Thanks in advance.
Daniel.

Dear Daniel,

To remove the author link, please add the following function into the child theme’s functions.php file.


/**
 * Prints HTML with meta information for the current post-date/time and author.
 */
function sydney_posted_on() {
	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
		$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
	}

	$time_string = sprintf( $time_string,
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() ),
		esc_attr( get_the_modified_date( 'c' ) ),
		esc_html( get_the_modified_date() )
	);

	$posted_on = sprintf(
		_x( 'Posted on %s', 'post date', 'sydney' ),
		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
	);

	$byline = sprintf(
		_x( '%s', 'post author', 'sydney' ),
		'<span class="author vcard">' . esc_html( get_the_author() ) . '</span>'
	);

	echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';

	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
		echo '<span class="comments-link">';
		comments_popup_link( __( 'Leave a comment', 'sydney' ), __( '1 Comment', 'sydney' ), __( '% Comments', 'sydney' ) );
		echo '</span>';
	}

	$categories_list = get_the_category_list( __( ', ', 'sydney' ) );
	if ( $categories_list && sydney_categorized_blog() ) {
		printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'sydney' ) . '</span>', $categories_list );
	}
}

If you haven’t been running a child theme or don’t want to use it, you can add the code using the Functionality plugin.

Regards,
Kharis

Hi Kharis,

Thanks for a good theme.

Can you please help with the following:

I need to remove ‘Post on’ and Author link on all pages in sections Services and Projects.

In section News I need to remove only Author link.

I do not use a child theme and have no idea how to do it (I am not a coder or IT-related professional).
I istalled Functionality plagin, activated it and it appeared on the admin panel on the left, but when I clicked on it it says ‘There is no such file’.

Am I doing something wrong?

Thanks in advance!

Hello there,

From Plugins > Edit Functions > select “WP Themes” on “Select plugin to edit:” dropdown options. Then add the following code:


/**
 * Prints HTML with meta information for the current post-date/time and author.
 */
function sydney_posted_on() {
	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
		$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
	}

	$time_string = sprintf( $time_string,
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() ),
		esc_attr( get_the_modified_date( 'c' ) ),
		esc_html( get_the_modified_date() )
	);

  if( get_post_type() == 'post'  ){
  	$posted_on = sprintf(
  		_x( 'Posted on %s', 'post date', 'sydney' ),
  		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
  	);
  }

	$byline = sprintf(
		_x( '%s', 'post author', 'sydney' ),
		'<span class="author vcard">' . esc_html( get_the_author() ) . '</span>'
	);

  if( get_post_type() == 'post'  ){
	   echo '<span class="posted-on">';
  }
  echo $posted_on;
  if( get_post_type() == 'post'  ){
    echo '</span>';
  }
  echo '<span class="byline"> ' . $byline . '</span>';

	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
		echo '<span class="comments-link">';
		comments_popup_link( __( 'Leave a comment', 'sydney' ), __( '1 Comment', 'sydney' ), __( '% Comments', 'sydney' ) );
		echo '</span>';
	}

	$categories_list = get_the_category_list( __( ', ', 'sydney' ) );
	if ( $categories_list && sydney_categorized_blog() ) {
		printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'sydney' ) . '</span>', $categories_list );
	}
}

Regards,
Kharis