Note that there are some explanatory texts on larger screens.

plurals
  1. POFirst post with different style and others post with different style
    primarykey
    data
    text
    <p>i've this problem with WP_Query and the HTML output:</p> <p>The Query:</p> <pre><code>&lt;!-- Category posts --&gt; &lt;!-- Entretencion --&gt; &lt;article class="six column"&gt; &lt;?php $caps = new WP_Query(); $caps-&gt;query('posts_per_page=4&amp;category_name=entretencion'); while($caps-&gt;have_posts()) { $caps-&gt;the_post(); $count++; if($count == 1) { ?&gt; &lt;!--First post --&gt; &lt;h4 class="cat-title"&gt;&lt;a href="#"&gt;&lt;?php $category = get_the_category(); echo $category[0]-&gt;cat_name; ?&gt;&lt;/a&gt;&lt;/h4&gt; &lt;div class="post-image"&gt; &lt;a href="#"&gt;&lt;img src="&lt;?php bloginfo( 'template_url' ); ?&gt;/upload/imagepost1.jpg" alt=""&gt;&lt;/a&gt; &lt;/div&gt; &lt;div class="post-container"&gt; &lt;h2 class="post-title"&gt;Create a Flexible Folded Paper Effect Using CSS3 Features&lt;/h2&gt; &lt;div class="post-content"&gt; &lt;p&gt;Venenatis volutpat orci, ut sodales augue tempor nec. Integer tempus ullamcorper felis eget dipiscing. Maecenas orci justo, mollis at tempus ac, gravida non&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="post-meta"&gt; &lt;span class="comments"&gt;&lt;a href="#"&gt;24&lt;/a&gt;&lt;/span&gt; &lt;span class="author"&gt;&lt;a href="#"&gt;nextwpthemes&lt;/a&gt;&lt;/span&gt; &lt;span class="date"&gt;&lt;a href="#"&gt;13 Jan 2013&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; &lt;!-- End of first post --&gt; &lt;?php } if($count &gt;= 2) { //Contador ?&gt; &lt;!-- Second and others posts --&gt; &lt;div class="other-posts"&gt; &lt;ul class="no-bullet"&gt; &lt;!-- Repeat this list with post 2, 3, and 4 --&gt; &lt;li id="&lt;?php echo $post-&gt;ID; ?&gt;"&gt; &lt;a href="#"&gt;&lt;img src="&lt;?php bloginfo( 'template_url' ); ?&gt;/upload/thumb1.jpg" alt=""&gt;&lt;/a&gt; &lt;h3 class="post-title"&gt;&lt;a href="#"&gt;Check Out the New Recommended Resources on Webdesigntuts+&lt;/a&gt;&lt;/h3&gt; &lt;span class="date"&gt;&lt;a href="#"&gt;13 Jan 2013&lt;/a&gt;&lt;/span&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;?php } // Fin contador ?&gt; &lt;?php } ?&gt; &lt;/article&gt; </code></pre> <p> </p> <p>But the HTML output repeat 3 div with class <code>other-post</code>.</p> <p>The problem (left) the original (right)</p> <p><img src="https://i.stack.imgur.com/aHWoz.png" alt="enter image description here"></p> <p>How to repeat only li tags?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload