Вопрос

Alright y'all. I want to dynamically display the information of the 2 most current posts to the screen. So far I have only been able to get results by hard coding the ID into the query. Is there a way to retrieve this data dynamically?

query_posts('showposts=2'); 

 while (have_posts()) : the_post(); ?>

<?php $x = get_the_ID(); 
echo $x;
$postStuff = $wpdb->get_row('select * from wp_posts where ID = "$x", ARRAY_A);
print_r($postStuff); ?>

<?php endwhile;?>

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с wordpress.stackexchange
scroll top