0
我一直試圖在Wordpress博客中插入<hr/>
標籤的帖子。我怎麼能這樣做,使最後一篇文章後沒有<hr/>
標籤?如何插入<hr/>標籤之間Wordpress的語義主題
我一直試圖在Wordpress博客中插入<hr/>
標籤的帖子。我怎麼能這樣做,使最後一篇文章後沒有<hr/>
標籤?如何插入<hr/>標籤之間Wordpress的語義主題
嘗試使用支票這樣的:
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);
$result = mysql_query("SELECT * FROM users", $link);
$num_rows = mysql_num_rows($result);
$i=0;
while ($row = mysql_fetch_assoc($result)) {
$i++;
echo $row["userid"];
echo $row["fullname"];
echo $row["userstatus"];
if ($i == $num_rows)
break;
echo '<hr>';
}
mysql_free_result($result);
<?php
$args = array('YOUR_QUERY_ARGS');
$query = new WP_Query($args);
$i=1;
if($query->have_posts()) : while($query->have_posts()) : $query->the_post();
?>
<!-- YOUR POSTS HERE -->
<?php
echo $i==$query->found_posts ? '' : '<hr/>';
$i++;
endwhile;endif;
?>
我會強烈建議使用WP Query到位query_posts()如果您還不是的。