For some reason my simple wordpress query_posts is omitting the latest (first) link from my loop.query_posts WordPress的循环同时省略第一<a href"">
See here:
<?php query_posts('category_name=blog&showposts=2'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<p><?php echo wp_trim_excerpt(); ?></p>
<span class="readmore">
<a href="<?php the_permalink(); ?>">Read more...</a>
</span>
<?php endwhile;?>
It's outputting everything expected, however the first <a href="">
is not getting appended to, for example 'Blog Post 2'.
HTML output
Blog Post 2
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna.</p>
<span class="readmore">
<a href="http://xxx/?p=58">Read more...</a>
</span>
<a href="xxx">Blog Post 1</a>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna.</p>
<span class="readmore">
<a href="http://xxx/?p=55">Read more...</a>
</span>
<a class="more-news" href="">More news..</a>
As you can see, it's not wrapping 'Blog Post 2' in a <a>
tag.
我thiking权,这是无效的HTML? – SMacFadyen 2012-01-18 14:36:33
如果您也可以发布输出HTML,可能会有所帮助。 – 2012-01-18 14:39:38
HTML在那里...... – SMacFadyen 2012-01-18 14:42:21