Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to remove the link from the date in the Twenty Sixteen WordPress theme

If you want to remove the link from the date field in the meta-information of the WordPress Twenty Sixteen theme, follow the following steps:

1. Create a child theme

A child Theme is a theme which inherits its style and behaviour from its parent theme, but allows you to modify functions and styles. These changes are kept upon a theme update. If you don’t create a child theme, you’ll lose your changes when the theme is updated.

To create a child theme you can refer to How to create a child theme in Twenty Sixteen.

2. Add the twentysixteen_entry_date() function to functions.php of you child theme

Now you only have to add the following function to your functions.php file of your child theme. The function is quite similar to its parent version, but the link from the date field has been removed.

/**
 * From inc/template-tags.php
 * Prints HTML with date information for current post.
 * @since Twenty Sixteen Child 1.0
 */
function twentysixteen_entry_date() {
	$time_string = '';

	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
		$time_string = '';
	}

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

	printf( '%1$s %2$s',
		_x( 'Posted on', 'Used before publish date.', 'twentysixteen' ),
		$time_string
	);
}

That’s all!

The post How to remove the link from the date in the Twenty Sixteen Wordpress Theme appeared first on Just Think.



This post first appeared on Just Think, please read the originial post: here

Share the post

How to remove the link from the date in the Twenty Sixteen WordPress theme

×

Subscribe to Just Think

Get updates delivered right to your inbox!

Thank you for your subscription

×