Strtotime with variable in wordpress
I tried changing this code:
function filter_where( $where = '' ) { $where .= " AND post_date > '" . date('Ym-d', strtotime('-365 days')) . "'"; return $where;} add_filter( 'posts_where', 'filter_where' ); in that:
function filter_where( $where = '' ) { $where .= " AND post_date > '" . date('Ym-d', strtotime('-'.$timestamp.' days')) ."'"; return $where;} add_filter( 'posts_where', 'filter_where' ); You may notice that I tried to put the $ timestamp variable inside strtotime. However, the code does not work. I made the correct syntax to put a variable in the strtotime PHP function?
I appreciate any help.