how does category really works? (4 posts)

  1. pedenski
    Posted 3 years ago #

    Ive been re-reading the codex and its just very confusing to me. ive been doing trial and error but cant seem to make it actually work the way i want it to be. please understand that im quite new in WP

    Questions below:

    1) is category.php necessary? is this something i need to show a posts from a specific category. (e.g cars) all cars posts should be displayed here
    OR its a page where all categories is listed (like if i have more than 1 categories)?

    2) i created a category.php and used this code

    <?php get_header(); ?>
    Template Name: CARS
    <?php query_posts('category_name=cars&showposts=15'); ?>
    <?php while (have_posts()) : the_post(); ?>
            <li><a href="<?php the_permalink(); ?>">
              <?php the_content(); ?>
              </a>  </li>
            <?php endwhile; ?>
    <?php get_footer(); ?>

    ^ not sure if this is standard, or should i create a custom php page (like cars.php) and use it as a template page.


  2. Pioneer Web Design
    Posted 3 years ago #

    Have you tried the template CATEGORY NAME.php (for example...news.php)and associated menu item?

  3. pedenski
    Posted 3 years ago #

    yes, i did. as i said above. i created cars.php

    i just want to clarify the standards of putting category.php and its purpose.

  4. Pioneer Web Design
    Posted 3 years ago #

    Review what (if) support for custom page templates is provided for/with theme/child theme.

Topic Closed

This topic has been closed to new replies.

About this Topic