I am modifying my Wordpress loop so it only shows posts that were published after the current logged in user was registered. To get the date the user registered I am using the following successfully -
<?php $regdate = date("Y-d-m", strtotime(get_userdata(get_current_user_id( ))->user_registered)); ?>
To modify the loop I am using the below successfully -
<?php
function filter_where($where = '') {
$where .= " AND post_date >= '2010-02-18'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string);
?>
What I need help with is passing the $regdate variable in place of the text date '2010-02-18'. I've tried a few variations but it breaks. I'm sure this is quite simple for anyone PHP savvy... please help!