• Resolved flipper26

    (@flipper26)


    I think I am going mad but I can not get my home.php to just display one category? Can any one help I have read lots and as far as I can tell I am doing as they say and it’s just not working?

    Any help will be greatly appreciated? see below…

    <?php
    get_header();
    ?>

    <?php query_posts('cat=31'); ?>

    <div id="content">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="entry">
    <h3 class="entrytitle" id="post-<?php the_ID(); ?>"> <a>" rel="bookmark">
    <?php the_title(); ?>
    </a> </h3>
    <div class="entrymeta"> Posted
    <?php
    the_time('F j, Y ');
    $comments_img_link= '<img src="' . get_stylesheet_directory_uri() . '/images/comments.gif" title="comments" alt="*" /><strong>';

    comments_popup_link($comments_img_link .' Comments(0)', $comments_img_link .' Comments(1)', $comments_img_link . ' Comments(%)');
    edit_post_link(__(' Edit'));?>
    </strong> </div>
    <div class="entrybody">
    <?php the_content(__('Read more &raquo;'));?>
    <div class="sociable">
    <?php if(function_exists('wp_email')) { email_link(); } ?>
    </div>
    </div>
    <!--
    <?php trackback_rdf(); ?>
    -->
    </div>
    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endwhile; else: ?>
    <p>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    </p>
    <?php endif; ?>
    <p>
    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    </p>

    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • I see this marked as resolved. Would you like to share your solution for the next searcher?

    From

    <?php query_posts('cat=31'); ?>

    <div id="content">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    To This

    <?php query_posts('cat=31'); ?>

    <div id="content">
    <?php while (have_posts()) : the_post(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show one category on home.php’ is closed to new replies.