Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //* Shortcode to display the current date, month and year in WordPress
- //* shortcode: [date_month_year]
- add_shortcode( 'date_month_year' , 'current_date_month_year' );
- function current_date_month_year() {
- $year = date("Y");
- $month = date("F");
- $date = date("D");
- return "$date, $month, $year";
- }
- add_filter( 'the_title', 'do_shortcode' ); // activate shortcode in WP Title
- add_filter( 'wpseo_title', 'do_shortcode' ); // activate shortcode in Yoast Title
- add_filter( 'wpseo_metadesc', 'do_shortcode' ); // activate shortcode in Yoast Meta Description
Add Comment
Please, Sign In to add comment