Is there a way to bring, automaticaly, an old edited/modified post in the front of page?
More clear, I want that every time when i edit a post to display it in front of my page, like sticky posts or something.
Is that possible?
Edit
First, thanks for your promptly answer!
Yes, in part this is it, but it’s not exactly what I want.
This function add posts in front of my page and it’s OK:
<?php query_posts($query_string . '&orderby=modified&order=desc'); ?>
but, in addition, I would like this to happen in sidebar too, in “recent posts widget” and in “Featured Posts Grid“, it’s the Featured Content Slider that i use it.
This function doesn’t work for me, i don’t know why:
<?php
function wpse10691_alter_query( $query )
{
if ( $query->is_main_query() && ( $query->is_home() || $query->is_search() || $query->is_archive() ) )
{
$query->set( 'orderby', 'modified' );
$query->set( 'order', 'desc' );
}
}
add_action( 'pre_get_posts', 'wpse10691_alter_query' );
?>
From what I understand you want to order posts by their modified date.
If so, then this should be a solution:
How to order posts by modified date without using ‘query_posts’?
PROBLEM SOLVED !
This is the solution:
Thanks, guys!