hi
How to Display Recent Last 48 Hours Posts in WordPress ?
its very important to me !
hi
How to Display Recent Last 48 Hours Posts in WordPress ?
its very important to me !
laso
now i am using this code :
<?php
global $post;
$myposts = get_posts('numberposts=20');
foreach($myposts as $post) :
setup_postdata($post);
?>
that its for display last 20 post updated ! but its not usable to me
there are time parameters for the query:
http://codex.wordpress.org/Function_Reference/WP_Query#Time_Parameters
caveat:
not tested, if all these methods work with get_posts()
!!
i write this code but its dont work(even it dont display):
<?php
function filter_where($where = '') {
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-2 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
$query = new WP_Query( $query_string );
?>
plz help to me
where are you going to use the code?
in a page template?
or in index.php?
the following might work in a page template:
http://pastebin.com/k7fx4iZf
can you post a link to your site to illustrate what you are trying to achieve?
lsidebar.php
try to use this code:
This topic has been closed to new replies.