我正在尝试修改的 wordpress 插件中有一个循环。
$dataarray = explode(',',$data);
foreach ($dataarray as $entry){
$sql .= "OR ID = '$entry' ";
}
$endvar = wp_parse_args( $var, $defaults );
extract( $endvar, EXTR_SKIP );
$sql = preg_replace("/^OR./","", $sql);
$order = $endvar['order_by'];
$my_posts = $wpdb->get_results("SELECT * FROM $table_name2 WHERE $sql ORDER BY $order");
$mod_url = mfp_create_link_url();
foreach ($my_posts as $entry){
echo get_the_post_thumbnail($entry->ID, 'thumbnail');
$fav_post .= $entry_before."<a href='".get_permalink($entry->ID)."' title='".$entry->post_title."' class='".$endvar['link_class']."'>".$entry->post_title."</a>".$entry_after;
echo $fav_post;
echo pippin_excerpt_by_id($entry);
}
这显示;
<thumbnail-1>
<title-1>
<excerpt-1>
<thumbnail-2>
**<title-1>**
<title-2>
<excerpt-2>
我不明白为什么它显示<title-1>
两次,而其他只显示一次。