I've tried to change this code:
function filter_where( $where = '' ) {
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-365 days')) . "'";
return $where;}
add_filter( 'posts_where', 'filter_where' );
into this one:
function filter_where( $where = '' ) {
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-'.$timestamp.' days')) ."'";
return $where;}
add_filter( 'posts_where', 'filter_where' );
You may noticed that I've tried to put variable $timestamp inside strtotime. However the code doesn't work. Did I do the correct syntax to put the variable within the strtotime PHP function?
I appreciate any kind of help.