Need some quick php help

by clare1982 5 replies
Hiya

I have been working on a blog with wordpress, and when I click on a certain category it only brings up one post on the category page instead of a list of posts in that category.

I have looked in the admin panel to see if it is as simple as turning it on and off, but I cant seem to find anything.

Anyway this is the code in the category.php template:

<?php get_header(); ?>

<div class="post">
<h2 class="section-header"><?php single_cat_title(); ?></h2>
<div class="entry">
<?php echo category_description(); ?>
</div>
</div>

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

<div class="post">

<h3 class="post-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h3>

<?php echo get_the_image_link(array('Thumbnail'), 'thumbnail'); ?>

<div class="entry">
<?php the_excerpt(); ?>
</div>
</div>

<?php endwhile; ?>

<?php else: ?>

<p><?php _e('Sorry, no posts matched your criteria.','structure'); ?></p>

<?php endif; ?>

<div class="navigation-links section">
<?php posts_nav_link('',
'<span class="previous">&laquo; '.__('Previous Page','structure').'</span>',
'<span class="next">'.__('Next Page','structure').' &raquo;</span>'
); ?>
</div>

<?php include(TEMPLATEPATH . '/includes/widget-blocks.php'); ?>

<?php get_footer(); ?>


What would I need to change in that code to get the category pages to list more posts from that category instead of just one post.

Any help would be appreciated.

Thanks
Clare
#main internet marketing discussion forum #php #quick
Avatar of Unregistered
  • Profile picture of the author zerofill
    Unfortunately that doesn't say a whole lot to us PHP geeks...Wordpress is full of functions and classes that are referenced. Like references like this --> have_posts()

    I would have to see what is going on in those functions first.

    Unless someone here messes with modifying wordpress all the time...

    Your positive your other posts are listed in the categories and you have it set to display more than 1 post? Your sure these are posts and not pages?
    Signature
    Serp Shaker
    The IM World Will Be Shaken to the Core!
    Join my list at: IMCool.Biz
    New Podcast --> podcast.imcool.biz
    {{ DiscussionBoard.errors[6441].message }}
    • Profile picture of the author clare1982
      Thanks zerofill for your reply

      Yes I am positive there are more posts in that category. I searched my dashboard for any options to have it displaying more than one and couldn't find any, I hope I'm not being blind here lol.

      Thanks
      Clare
      {{ DiscussionBoard.errors[6447].message }}
      • Profile picture of the author zerofill
        Go to settings then reading....

        look at the value in ---> Blog pages show at most

        Think the default is usually 10
        Signature
        Serp Shaker
        The IM World Will Be Shaken to the Core!
        Join my list at: IMCool.Biz
        New Podcast --> podcast.imcool.biz
        {{ DiscussionBoard.errors[6449].message }}
        • Profile picture of the author clare1982
          Thanks zerofill

          That does solve the problem , I'm sure I get brainfreeze sometimes lol.
          The only thing is I had it set to 1 because I wanted the front page to only contain 1 post at a time, I didn't think it would affect the category pages too.
          Anyway thanks very much, appreciate it.

          Clare
          {{ DiscussionBoard.errors[6461].message }}
Avatar of Unregistered

Trending Topics