Get an article with an update date of less than 90 days in WordPress

Asked 1 years ago, Updated 1 years ago, 65 views

Current state code

array(
    'post_type' = > 'post',
    'post_status' = > 'public',
    'after' = > date('Y/m/d 0:0:0', strtotime('-3month')',
);

I was doing this, but with this, do you only get articles that are more than three months old?I realized that
What should I do if I only get articles with an update date of less than 90 days?

php wordpress

2022-09-30 11:12

1 Answers

I was able to use date_query

'date_query'=>array(
    array( 
        'column' = > 'post_modified',
        'inclusive' = > true,
        'after' = > date('Y/m/d 0:0:0', strtotime('-3month')',
    ),
),


2022-09-30 11:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.