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.
前に、この不正なHTMLで省略されていますか? – SMacFadyen
出力HTMLを投稿することができれば役に立つかもしれません。 –
HTMLはそこにあります... – SMacFadyen