want to show post modified instead of published date

Posted in: Newspaper
Post count: 15

i just want to change show post date

i want to show post modified date in stead of published date site wide

also one more if possible i want to show all modified post to appear in latest post or blog page also in archive page….

Post count: 1291

Hi,

1. Try the solution provided here – https://forum.tagdiv.com/topic/how-to-add-last-updated-time/
2. You mean you want to change the sort order for archive pages? and on the blog page?
For this you have to look for a plugin or a piece of code similar to this:

add_action('pre_get_posts','sort_posts_by_modified');

function sort_posts_by_modified($x) {
	if($query->is_main_query() && is_archive()) {
		$x->query_vars['orderby'] = 'modified';
		$x->query_vars['order'] = 'ASC';
	}
}

Beside is_archive you can add multiple conditions to target various page, you can read about it here – https://codex.wordpress.org/Conditional_Tags
If you don’t know how to do this i suggest that you look for a professional to help you with this task, you can find one on places like – http://studio.envato.com/

Thank you!

  • This reply was modified 10 years by Emil G.
  • This reply was modified 10 years by Emil G.
Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.