【发布时间】:2017-05-03 11:06:15
【问题描述】:
我有这个代码
global $post;
$size = array(75,75);
$args = array( 'numberposts' => 3, 'category' => 'Allgemein' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) { setup_postdata($post);
echo the_title();
echo "<br>";
echo the_excerpt();
echo "<br>";
echo the_permalink();
echo "<br>";
echo get_the_post_thumbnail($post_id, $size);
echo "<br>";
};
如何将每个帖子的数据保存在不同的变量中?:
$post9_title = $latesposts[8]->the_title();
在此先感谢,感谢您提供的任何帮助。
【问题讨论】:
标签: php arrays wordpress variables