大家好我是新來的wp插件開發。到目前爲止,除了這個表格選擇部分似乎在踢我的腦袋外,我的表現很好。我試圖在選擇字段中顯示最近發佈的帖子列表,供管理員選擇並執行一些操作,但標題不會顯示。我在單選按鈕甚至文本字段中試過這個,但沒有得到任何結果。請問,我在這個表格中錯過了什麼?如何使用get_posts()和表單select
<form method="post"><select name="Article">
$args = array('numberposts' => 10, 'order'=> 'ASC', 'orderby' => 'title');
$postslist = get_posts($args); foreach ($postslist as $post) : setup_postdata($post);
echo'<option value='".the_ID()."'>'".the_title()."'</option>';
endforeach;
echo"</select></form>";