Skip to main content
added 203 characters in body
Source Link

I need get a post only if publish_date is equal to modified date in this case the post is not modified! So i need post NOT MODIFIED!:

My query is:

 $lastupdated_args = array(
        'post__not_in' => $to_exclude,
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'meta_key''date_query' => 'vip_box',[
        'meta_compare'[ 'before' => 'NOT'post_modified' EXISTS',]
     ],
   'meta_query' => array( //NEW UPDATE QUERY'date_query' FOR=> DATE[
           [ array(
             'column'   'key' => $query->modified'post_modified_gmt', 
            'after'    'value' => $query->publish_date'post_date_gmt',
     
            'compare''inclusive' => '=',
     false  
        ]
  'type' => 'DATE'],
         
    )
 ;  

    function wpse_modified( $where )
    );{

But nothing work i have also tried with:

$lastupdated_args = array(
array(
      global $wpdb;
        // 'key'Run =>only 'modified',once:
          remove_filter( current_filter(), __FUNCTION__ );
   'value' => 'publish_date',
   // Append custom SQL
        return $where 'compare'. =>" '=',
AND {$wpdb->posts}.post_modified} != {$wpdb->posts}.post_modified} ";
    }

    add_filter( 'posts_where', 'wpse_modified' );

 'type' => 'DATE'
 $lastupdated_loop = new WP_Query( $lastupdated_args );
    query_posts( $lastupdated_args );

How to get a dynamic value like date (published and modified) during this query for comparison?

I need get a post only if publish_date is equal to modified date in this case the post is not modified! So i need post NOT MODIFIED!:

My query is:

$lastupdated_args = array(
        'post__not_in' => $to_exclude,
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'meta_key' => 'vip_box',
        'meta_compare' => 'NOT EXISTS',
        'meta_query' => array( //NEW UPDATE QUERY FOR DATE
            array(
                'key' => $query->modified,
                'value' => $query->publish_date,
                'compare' => '=',
                'type' => 'DATE'
            )
         )
    );

But nothing work i have also tried with:

$lastupdated_args = array(
array(
                'key' => 'modified',
                'value' => 'publish_date',
                'compare' => '=',
                'type' => 'DATE'
            )

How to get a dynamic value like date (published and modified) during this query for comparison?

I need get a post only if publish_date is equal to modified date in this case the post is not modified! So i need post NOT MODIFIED!:

My query is:

 $lastupdated_args = array(
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'date_query' => [
        [ 'before' => 'post_modified' ]
    ],
        'date_query' => [
        [ 
            'column'    => 'post_modified_gmt', 
            'after'     => 'post_date_gmt',  
            'inclusive' => false  
        ]
    ],
         
    );  

    function wpse_modified( $where ) {
        global $wpdb;
        // Run only once:
        remove_filter( current_filter(), __FUNCTION__ );
        // Append custom SQL
        return $where . " AND {$wpdb->posts}.post_modified} != {$wpdb->posts}.post_modified} ";
    }

    add_filter( 'posts_where', 'wpse_modified' );

    $lastupdated_loop = new WP_Query( $lastupdated_args );
    query_posts( $lastupdated_args );

How to get a dynamic value like date (published and modified) during this query for comparison?

POST NOT MODIFIED!!!
Source Link

I need get a post only if publish_date is equal to modified date in this case the post is not modified! So i need post NOT MODIFIED!:

My query is:

$lastupdated_args = array(
        'post__not_in' => $to_exclude,
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'meta_key' => 'vip_box',
        'meta_compare' => 'NOT EXISTS',
        'meta_query' => array( //NEW UPDATE QUERY FOR DATE
            array(
                'key' => $query->modified,
                'value' => $query->publish_date,
                'compare' => '=',
                'type' => 'DATE'
            )
        )
    );

But nothing work i have also tried with:

$lastupdated_args = array(
array(
                'key' => 'modified',
                'value' => 'publish_date',
                'compare' => '=',
                'type' => 'DATE'
            )

How to get a dynamic value like date (published and modified) during this query for comparison?

I need get a post only if publish_date is equal to modified date:

My query is:

$lastupdated_args = array(
        'post__not_in' => $to_exclude,
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'meta_key' => 'vip_box',
        'meta_compare' => 'NOT EXISTS',
        'meta_query' => array( //NEW UPDATE QUERY FOR DATE
            array(
                'key' => $query->modified,
                'value' => $query->publish_date,
                'compare' => '=',
                'type' => 'DATE'
            )
        )
    );

But nothing work i have also tried with:

$lastupdated_args = array(
array(
                'key' => 'modified',
                'value' => 'publish_date',
                'compare' => '=',
                'type' => 'DATE'
            )

How to get a dynamic value like date (published and modified) during this query for comparison?

I need get a post only if publish_date is equal to modified date in this case the post is not modified! So i need post NOT MODIFIED!:

My query is:

$lastupdated_args = array(
        'post__not_in' => $to_exclude,
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'meta_key' => 'vip_box',
        'meta_compare' => 'NOT EXISTS',
        'meta_query' => array( //NEW UPDATE QUERY FOR DATE
            array(
                'key' => $query->modified,
                'value' => $query->publish_date,
                'compare' => '=',
                'type' => 'DATE'
            )
        )
    );

But nothing work i have also tried with:

$lastupdated_args = array(
array(
                'key' => 'modified',
                'value' => 'publish_date',
                'compare' => '=',
                'type' => 'DATE'
            )

How to get a dynamic value like date (published and modified) during this query for comparison?

Source Link

WP_Query compare with dynamic values

I need get a post only if publish_date is equal to modified date:

My query is:

$lastupdated_args = array(
        'post__not_in' => $to_exclude,
        'paged' => $paged,
        'orderby' => 'modified',
        'ignore_sticky_posts' => '1',
        'post_status' => 'publish',
        'post_type' => 'post',
        'meta_key' => 'vip_box',
        'meta_compare' => 'NOT EXISTS',
        'meta_query' => array( //NEW UPDATE QUERY FOR DATE
            array(
                'key' => $query->modified,
                'value' => $query->publish_date,
                'compare' => '=',
                'type' => 'DATE'
            )
        )
    );

But nothing work i have also tried with:

$lastupdated_args = array(
array(
                'key' => 'modified',
                'value' => 'publish_date',
                'compare' => '=',
                'type' => 'DATE'
            )

How to get a dynamic value like date (published and modified) during this query for comparison?