wordpress displaying the post in a specific categories

Posted by Juliver Galleto on Stack Overflow See other posts from Stack Overflow or by Juliver Galleto
Published on 2012-10-07T21:33:16Z Indexed on 2012/10/07 21:37 UTC
Read the original article Hit count: 268

Filed under:
|
|

I have this php code below for displaying the post from the specific categories.

<ul id="sliderx">
<?php query_posts('category_name=slideshow&showposts=10');
while (have_posts()) : the_post();
echo "<li>".the_content()."</li>";
endwhile;?>
</ul>

as you can see, it display those post in the category slideshow and the structure of that should be this.

<ul id="sliderx">
<li>the post 1</li>
<li>the post 2</li>
<li>the post 3</li>
</ul>

but the output that is generated is this.

<ul id="sliderx">
<p>three</p>
<li></li><p>two</p>
<li></li><p>one</p>
<li></li>
</ul>

and the generated structure should not look like that and it looks nasty at all, so im having a problem on this on how to display it properly like to display into this structure.

<ul id="sliderx">
<li>the post 1</li>
<li>the post 2</li>
<li>the post 3</li>
</ul>

So Im wondering if there's someone who could tell me how to fix this.

Im open into any suggestions, recommendations and suggestions. Thank you.

© Stack Overflow or respective owner

Related posts about php

Related posts about html