WordPress.org

Ready to get started?Download WordPress

Forums

Blog that only shows specific category? (8 posts)

  1. ventilate
    Member
    Posted 2 years ago #

    Is there a way to have to have a blog only show a specific post category?

    thanks in advance.

  2. Cathy Tibbles
    Member
    Posted 2 years ago #

    Yes, you can use a plugin for that. Search theplugin directory - I dont know of one off the top of my head.
    Otherwise, you can edit the blog's loop with an argument like this "&cat=xx" to display only the category you want. First you need to find the loop that the blog is using - using the template hierarchy & a knowledge of your theme. Here's the page explaining the hierarchy: http://codex.wordpress.org/Template_Hierarchy

    Obviously the easiest solution is a plugin. :)

  3. ventilate
    Member
    Posted 2 years ago #

    Thank you Cathy! ; )

    If I want to show multiple cat's could I use this?

    "&cat=xx01, xx02, xx03"

    cheers,

  4. Cathy Tibbles
    Member
    Posted 2 years ago #

    Yes - this should give you the info you need. Dont forget to reset the query if you want to use it again. http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters

  5. ventilate
    Member
    Posted 2 years ago #

    Hi Cathy, hoping you can help me with this, having a bit of trouble for a non-coder ; ) Where would I put "&cat=xx" in this code?

    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="entry"><?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php the_content('Read the rest of this entry »'); ?>
    <img src="http://www.ventilate.ca/images/issue_08/fill.jpg" width="370" height="11">
    "><?php the_author() ?> - <?php the_time('F jS, Y') ?> - <?php the_time() ?>

    </div>

    <img src="http://www.ventilate.ca/images/issue_08/fill.jpg" width="5" height="5">
    <div align="center"><img src="http://www.ventilate.ca/images/news_horizontal.jpg"></div>
    <img src="http://www.ventilate.ca/images/issue_08/fill.jpg" width="5" height="20"></div>

    <?php endwhile; ?>
    <span class="alignleft">
    <?php next_posts_link('« Older posts') ?>
    <span class="alignright">
    <?php previous_posts_link('Newer posts »') ?>

    Thank you in advance ; )

  6. theplastickid
    Member
    Posted 2 years ago #

    put right at the top before the loop starts

    <?php 
    
    query_posts('cat=6');
    
    <!-- Start loop now -->
    
    ?> <!-- end loop -->
  7. ventilate
    Member
    Posted 2 years ago #

    Thank you so much!!

    How can I tell which categories coincide with the cat numbers?

    I tried using words like query_posts('cat=architecture'); .... but that doesnt work.

    cheers ; )

  8. ventilate
    Member
    Posted 2 years ago #

    found it ; )

    wp-admin/categories.php

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.