• I have two post loop , they are repeating twice in the page while i caled them just once???

    	<div class="announc">
          <h2> إعلانات </h2>
    	<div class="announc-body">
    	<ul>
    	<?php
    		query_posts('cat=6');
    		if (have_posts() ){
    			while (have_posts()){
    			the_post();?>
    	<li> <a href=" <?php the_permalink() ?>" title="<?php the_title() ;
    			
    			?>">
    			<?php echo mb_strimwidth(get_the_title(), 0, 30, '...'); 
    			
    			?></a> </li>
    			<?php 
    			}
    		}
    		wp_reset_query();
    
    		?>
    	</ul>
    	</div>
    	</div>

    and

    	<div class="announc">
          <h2> مؤتمرات </h2>
    	<div class="announc-body">
    	<ul>
    	<?php
    		query_posts('cat=5');
    		if (have_posts() ){
    			while (have_posts()){
    			the_post();?>
    	<li> <a href=" <?php the_permalink() ?>" title="<?php the_title() ;
    			
    			?>">
    			<?php echo mb_strimwidth(get_the_title(), 0, 30, '...'); 
    			
    			?></a> </li>
    			<?php 
    			}
    		}
    		wp_reset_query();
    
    		?>
    	</ul>
    	</div>
    	</div>
    • This topic was modified 6 years, 6 months ago by Jan Dembowski. Reason: Moved to Developing with WordPress, this is not a Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @omarsvu Don’t create duplicate topics. I have archived your newer topic and moved this one to the correct sub-forum.

    Moderator bcworkz

    (@bcworkz)

    There is no problem with the code you posted, the extra pass is the result of something external to the posted code.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘post loop repeats’ is closed to new replies.