0

I'm trying to display a custom loop with only certain elements in it.

My loop currently contains the title, creation date, author & content.

However I am trying to remove the content for each post in the loop as I do not want it displayed in this list with no luck.

I have even removed the_content() out of the loop & it still displays a listing of the post content under the looped section.

Any help would be greatly appreciated,

here is my code:

<?php query_posts('category_name=halloween &posts_per_page=6'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- IF articles then display them -->

<h6><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h6>   
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

<?php endwhile; else: ?>
<!-- IF no articles were created then show -->

NO Posts Present 

<?php endif; ?>
2
  • I seemed to have found what i was missing in my code as there needed to be the following snippet of code required at the end of my loop which fixed the issue: here is the code which I added after my endif <?php wp_reset_query(); ?> Commented Mar 3, 2013 at 4:30
  • Please, don't Multi-post the same Question across the network.
    – brasofilo
    Commented Mar 3, 2013 at 12:19

1 Answer 1

0

I don't see anything that would cause the_content() to display in your code. Chances are, the template file you are editing is NOT the one being used on the page/archive you are checking.

Add this to the top of your template files...

<!-- Template: <?php echo __file__;  ?> -->

Now, in your web browser view source and locate "Template:" - which will tell you which template file(s) are being loaded for the current page. From there, you will be able to figure out which template file you should be working on. It might be the wrong file, or it might be the right file in the wrong theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.