• Hi, I am trying to use query_posts to pull posts from a specific category onto my homepage. I got it to partially work using the following code before the loop in loop.php

    <?php query_posts('category_name=Homepage&showposts=3'); ?>

    However, It will only show the post title and text and not any images that I have in the post. Any idea why this may be happening?

    I only have the nextgen gallery plugin installed and I deactivated it and I still have this issue. Thanks in advance for your time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Anthony

    (@a-bomb)

    I also just found out that if I put

    <?php query_posts('category_name=Homepage&showposts=3'); ?>

    on single.php and load a single post it returns exactly what I want to show. Also, if i put it on page.php and load a single page it returns what I need. So it must be an issue with the loop code or other homepage code?

    Any Ideas?

    There are three loops in loop.php. Which loop did you use your custom query with (I think it should be the last one, if I remember correctly)?

    Thread Starter Anthony

    (@a-bomb)

    Thanks for the reply.

    I put it in the beginning before

    <?php while ( have_posts() ) : the_post(); ?>

    At the beginning of which of the 3 loops in loop.php?

    Thread Starter Anthony

    (@a-bomb)

    It was at the beginning of the first loop. I think I figured out the problem. I copy and pasted all of the code from page.php into index.php and added

    <?php query_posts('category_name=Homepage&showposts=3'); ?>

    before the loop.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘query_posts not fully working in twentyten theme’ is closed to new replies.