Ich versuche, eine SQL-Abfrage in eine WordPress-Abfrage zu konvertieren, verstehe aber nicht, wie das geht?
Abfrage, in die ich versuche zu konvertieren new wp_query
$query = " SELECT SQL_CALC_FOUND_ROWS distinct wp_posts.ID
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.id = wp_postmeta.post_id )
INNER JOIN wp_postmeta AS mt1
ON ( wp_posts.id = mt1.post_id )
WHERE 1 = 1
AND wp_posts.id NOT IN ( 0 )
AND wp_posts.post_type="topic"
AND ( wp_posts.post_status="publish"
OR wp_posts.post_status="closed"
OR wp_posts.post_status="reported" )
AND ( wp_postmeta.meta_key = '_bbp_last_active_time')
GROUP BY wp_posts.id
ORDER BY wp_postmeta.meta_value DESC
LIMIT 0, 10
";
$topics = $wpdb->get_results($query, OBJECT);
damit ich es verwenden kann
while($topics->have_posts()) : $topics->the_post(); ?>
etw
$args = array(); // how do I convert to this.
$topics = new WP_query($args);