Get latest post revision with wp-query
Get latest post revision with wp-query
Get latest post revision with wp-query
Thanks, i got it now; indeed with meta_query. function my_recent_posts_shortcode( $atts ) { global $post; $currenttime = current_time(“mysql”); $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘newsbox-date’, ‘value’ => $currenttime, ‘compare’ => ‘>’ ) ) ); $newsbox = new WP_Query( $args ); if ( $newsbox->have_posts() ) : $list=”<div class=”newsbox-posts”>”; while ( … Read more
WP_Query with meta_query dosen’t return results
the_post_thumbnail prints data to the screen immediately. It does not return a string that you can concatenate into your $out variable. Use get_the_post_thumbnail instead. Make sure you get the arguments right. They are different from the arguments for the_post_thumbnail. Should be something like: get_the_post_thumbnail(get_the_ID(),’thumbnail’);
wp_update_post not working
OK so was way simpler than I thought in the end and didn’t involve a lot, just was approaching it in completely the wrong way: The same can be achieved like this: /*GETING THE USERS FIRST PUBLISHED SUBSCRIPTION?? */ $useremail = $ticket[’email’]; $user = get_user_by( ’email’, $useremail ); $IDuser = $user->ID; $args = array( ‘posts_per_page’ … Read more
What you are wanting to do is possible– MySQL can do math– but WP_Query can’t handle this natively. You’d need to apply a filter or two. You would end up sorting on generated values which is not especially efficient. That is, MySQL, would read all of the rows in the table for those two keys, … Read more
2 weeks ago from meta query meta value
New WP_Query loop in admin causes problems
The loop doesn’t really contain anything. It does include methods in order to easily output your data such as the_title(), this is done when calling the_post() Then, within the loop you’ll be able to use get_the_ID() and get_post_meta() to get your custom fields (including ACF ones). So if you have retrieved your desired posts from … Read more