php - How to change the way the date is displayed in WordPress -
i permanently remove the day , month date keep year. wordpress 4.8.1 running culture theme.
in other words; when i, in future, write , publish post, year shown on blogpage (frontpage) , on single post view.
any ideas on how fix that?
you can use below function , modify according requirement
function my_project_filter_publish_dates( $the_date, $d, $post ) { return date( 'y', strtotime( $the_date ) ); } add_filter( 'get_the_date', 'my_project_filter_publish_dates', 10, 3 );
Comments
Post a Comment