Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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; ?>
share|improve this question
    
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(); ?> –  user1823055 Mar 3 '13 at 4:30
    
Please, don't Multi-post the same Question across the network. –  brasofilo Mar 3 '13 at 12:19
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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