我想在查询中显示每个帖子标题旁边的帖子编号,这样看起来就像这样:
在查询中发布标题1在查询中发布标题2在查询中发布标题3如何操作?
<小时>
<?php
function ngtj_get_some_posts( $category_name )
{
// set the criteria
$args = array(
\'numberposts\' => 10,
\'post_type\' => array(\'feature\', \'post\')
);
// return the object array of the posts.
return get_posts( $args );
}
?>
<?php wp_nonce_field(\'update-options\') ?>
<?php
$posts_returned = ngtj_get_some_posts( \'CATEGORY_NAME\' );
foreach ( $posts_returned as $post_returned )
{
echo $post_returned->post_title.\'<input style="text-align: center;" type="text" name="postnumber" size="1">\'.$post_returned->ID.\'<br>\'.$post_returned->current_post.\'<input type="hidden" name="page_options" value="post_one" />\';
}
?>