• Hello everyone, why my Query post showing only 1 post? I need the all post from one category! I use these code:

    <?php
    query_posts('cat=60$posts_per_page=-1'); // query to show all posts independant from what is in the center;
    if (have_posts()) :
       while (have_posts()) :
          the_post(); ?>
    <li class="grid-artist">
    	<?php the_post_thumbnail(); ?>
          <a>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    
    <?php  endwhile;
    endif;
    wp_reset_query();
    ?>

    the code works well in custom-single.php, but when i put the same code in custom-archive.php it render only one post only.
    Need an advance…thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Wrap your code inside of backticks (`) or just highlight your code and click the “code” button to format it properly. It is quite hard to read unformatted code.

    You should also avoid using query_post, and switch things over to use WP_Query.

    Evan

    Thread Starter designtrial

    (@designtrial)

    hello Evan, i wrap the code well now. I’ll try WP_Query way..this is the link of the page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘why my query post showing only 1 post in custom-archive?’ is closed to new replies.