wordpress最新文章重复怎么破,代码以上 不知道哪里出问题了?
<div class="relates"><i class="fa fa-bars zuixin"></i><h2 class="title"><small>近期更新</small></h2>
<ul style="padding: 5px 0px 15px 20px;">
<?php
$result = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts where post_status='publish' and post_type='post' ORDER BY ID DESC LIMIT 0 , 20");
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
?>
<?php while (have_posts()) : the_post(); ?>
<li><i class="fa fa-file-text-o"></i><a class="lastitle" href="<?php
echo get_permalink($postid); ?>" title="<?php
echo $title ?>"><?php echo cut_str($post->post_title,38); ?></a>
<span class="list-date"><?php the_time('m/d') ?></span>
</li>
<?php endwhile; ?>
<?php
} ?>
</ul>
</div>
上传不了图片
<ul style="padding: 5px 0px 15px 20px;">
<?php
$result = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts where post_status='publish' and post_type='post' ORDER BY ID DESC LIMIT 0 , 20");
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
?>
<?php while (have_posts()) : the_post(); ?>
<li><i class="fa fa-file-text-o"></i><a class="lastitle" href="<?php
echo get_permalink($postid); ?>" title="<?php
echo $title ?>"><?php echo cut_str($post->post_title,38); ?></a>
<span class="list-date"><?php the_time('m/d') ?></span>
</li>
<?php endwhile; ?>
<?php
} ?>
</ul>
</div>
上传不了图片
3 个回复
[已注销]
赞同来自:
[已注销]
赞同来自:
[已注销]
赞同来自: