posts_where filter and offset
-
Hi all,
I’m trying to use posts_where filter to get posts from a specific time period. It’s working fine, but I can’t get it to work with offset (after x number of posts). Can anyone help me?
<?php function filter_where($where = '') { //posts in the last 10 days //$where .= " AND post_date > '" . date('Y-m-d', strtotime('-11 days')) . "'"; //posts 30 to 60 days old $where .= " AND post_date >= '" . date('Y-m-d', strtotime('-21 days')) . "'" . " AND post_date <= '" . date('Y-m-d', strtotime('-11 days')) . "'"; //posts for March 1 to March 15, 2009 //$where .= " AND post_date >= '2009-03-01' AND post_date <= '2009-03-15'"; return $where; } add_filter('posts_where', 'filter_where'); query_posts( 'cat=-3,-19,-88&offset=6&showposts=-1' ); ?>
posts_where filter: https://codex.www.ads-software.com/Plugin_API/Filter_Reference/posts_where
[please continue with your existing topic https://www.ads-software.com/support/topic/wordpress-posts_where-and-offset?replies=1 ]
- The topic ‘posts_where filter and offset’ is closed to new replies.