Support » Themes and Templates » category page

  • I created a category page and named it category-3.php

    The pages code is below:

    <?php get_header(); ?> <!-- header include -->
    	<div id="left">
    		<div id="left-top">
    			<h2>Product Catalog</h2>
    		</div><!-- end left-top -->	
    		<div class="blog-content">
    			<?php query_posts('cat=3&showposts=3'); ?>
    			<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    			<h2><?php the_title(); ?></h2>
    				<?php the_content(); ?>
    			<?php endwhile; ?>
    		</div><!-- end blog-content -->		
    		<div id="catalog-pages">
    				<?php posts_nav_link('<span style="padding-left: 50px"></span>','Previous','Next'); ?>
    		</div><!-- end catalog-page numbers -->
    	</div><!-- end left -->
    <?php get_sidebar(); ?> <!-- sidebar include -->
    <?php get_footer(); ?> <!-- footer include -->
    </div> <!-- wrap end -->

    I uploaded this into my theme folder and when i direct my browser to the page, it get “Nothing Here” and the content doesn’t show.

    What am I doing wrong?

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You don’t call template files directly in your browser. Category-3.php will be used by WordPress whenever WordPress is trying to provide a category listing for whichever of your categories has the ID of 3.

    Sorry, that’s a little convoluted but it is the best way I can think of to explain it. Does it make sense to you?

    I think I found how to directly call to the page in my browser.

    I use this link:

    When I do I get this error now:

    Parse error: syntax error, unexpected $end in /public_html/blog/wp-content/themes/mytheme/category-3.php on line 33

    The bit of code on line 33 is </html>

    Why would this be causing an error now?

    I believe you’re missing an endif after your endwhile. The problem isn’t actually on line 33.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘category page’ is closed to new replies.