Add Date to Single Blog Post

Hello – I am trying to display the publish date on my single blog posts. Here’s my code:

function add_date(){

		if ( is_single() && !is_page('Home')){
		$date = "<em>" . get_the_date( 'F j, Y' ) . "</em>"; 
		echo $date; 
		}
		else{
		/*do nothing*/
		}
}

add_action( ‘x_before_the_content_begin’,‘add_date’,10);

This does display the date on the single post; however, the date is also displaying on my Home page, even with the 2nd conditional !is_page(‘Home’) added. Can anyone tell me what I am doing wrong?

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.