cliff
7/21/2016 - 9:20 PM

Add meta description to The Events Calendar Month view

Add meta description to The Events Calendar Month view

<?php

// From https://gist.github.com/cliffordp/b8055fc5cfd9d9bf9298c93e3d84090c
// Add meta description to The Events Calendar Month view
// additional reference: https://support.google.com/webmasters/answer/79812
function cliff_add_meta_desc_month_archive() {
	if ( ! is_post_type_archive( 'tribe_events' ) || ! function_exists( 'tribe_is_month' ) ) {
		return;
	}
	
	if ( tribe_is_month() ) {
		echo '<meta name="description" content="Whatever you want"/>' . PHP_EOL;
	}
	
	return;
}
add_action( 'wp_head', 'cliff_add_meta_desc_month_archive' );