Need some quick php help

by 5 comments

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(); ?>

<?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>

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

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

<?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>'
); ?>

<?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.

#internet marketing #php #quick
  • 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?
    • 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.


Next Topics on Trending Feed

  • 1 {{ upvoteCount | shortNum }} 5

    The debate never seems to end in my circle of professional acquaintances. Would you rather be paid for projects based on an hourly or fixed rate?Argue as we may, we never do seem to come to a conclusion. I myself am of the opinion that there is no “right” or “wrong” answer necessarily. That being said, I have met many freelancers that are very passionate about one side or the other. For those that prefer fixed rates, they will often ask their hourly rate-preferring counterparts why they would ever be excited to trade their time for money. On the other hand, those that prefer hourly contracts wonder why anyone would agree to a project that may end up requiring much more effort than originally anticipated-- effort that would essentially go unpaid. I personally believe one’s preference for fixed or hourly contracts stems from the way that he or she views work. The individual that sees his or her completed task as product tend to favor fixed rate projects. They feel comfortable pricing a project based on the perceived value that the finished project will bring to the client. Those that see their availability and time as the primary product being offered to the client feel most comfortable billing a client in a similar manner. Interestingly enough, a couple of close friends of mine recently completed projects that they chose to bill using their preferred method. One, a web designer, typically bills clients a flat rate for projects he completes. Another friend, a graphic designer, prefers to bill hourly. Both recently completed projects where they ended up regretting the billing method that they chose! My web designer friend recently landed a gig where he was asked to do a complete redesign for an academic organization. He was thrilled when the client agreed to a very high fixed rate for the project. He was anticipating that the project would run somewhere between 3-4 months. In the end, the project ended up taking almost 6 months! After taking a look standard hourly rates in industry, he found he could have very easily made an additional 50% over the course of the project had he chosen to bill hourly. My graphic designer friend prefers to bill hourly. She has come to expect that clients will ask her for various edits. She offers as many edits as the client asks for as each of these edits is done on the clock. A recent project left her shocked and upset however when the client gladly accepted a project that was done in under a half hour. She ended up selling what she described as an “awesome, professional poster” for less than a quarter of what she would typically make. All this to say, no billing method is perfect in my opinion. As a developer, I tend to favor flat-rate projects. At the same time, I’m sure I can find freelancers doing similar work that prefer hourly billing. Which do you prefer and why? Do you have any personal anecdotes that would help me understand your reasoning?

  • 2 {{ upvoteCount | shortNum }} 5

    Hi, Im currently working for several clients, helping them with their Local SEO. I believe Local SEO is the best way local businesses can build a strong online presence, and im sure you all agree with this statement. People these days dont use the local yellow pages for searching for companies or places to buy products or services, they use the internet, and in particular, Google, thats why local SEO is so important, if you build a good rank in your location, customers will came to your place very fast. But local SEO is not an easy thing to do, it can get very complicated in big cities or states, specially if your competition is working on their SEO as well, so we all need to be updated with our techniques and make some efforts for improving everyday.