• When I right a new post in the other news category it shows up fine but, when I click on the read more section it takes me to the last post I entered. Need help please. View the test site here: http://www.shannonwheelerdesign.com

    All the posts in the section take me to the same post
    Here is the code:

    <?php get_header(); ?>
    <?php //category variables
    $cat1 = 1;
    $cat2 = 5;
    $cat3 = 4;

    $post_cat1 = get_posts(array(‘numberposts’ => 1,’category’ => $cat1));
    $descr_cat1 = get_the_category_by_ID($cat1);
    $post_cat2 = get_posts(array(‘numberposts’ => 1,’category’ => $cat2));
    $descr_cat2 = get_the_category_by_ID($cat2);
    $post_cat3 = get_posts(array(‘numberposts’ => 3,’category’ => $cat3));
    $descr_cat3 = get_the_category_by_ID($cat3);

    ?>
    <div id=”main”>
    <div class=”column”>
    <?php get_sidebar(); ?>
    </div>
    <div class=”content”>
    <div class=”top”>
    <div class=”inner”>
    <h3><span><?php echo $descr_cat1 ?></span></h3>
    </div>
    <div class=”inner-column”>
    <h3><span><?php echo $descr_cat3 ?></span></h3>
    </div>
    </div>
    <div class=”inner-content”>
    <div class=”inner”>
    <div class=”block”>
    <?php print $post_cat1[0]->post_content; ?>
    </div>
    <div class=”block”>
    <h3 class=”bord”><span><?php echo $descr_cat2 ?></span></h3>
    <?php print $post_cat2[0]->post_content; ?>
    </div>
    </div>
    <div class=”inner-column”>
    <?php if(!empty($post_cat3))
    {
    foreach($post_cat3 as $col_post)
    {
    setup_postdata($col_post);
    $exc = get_the_excerpt();
    echo ‘<p>’.$exc.’guid.'”>Read more.</p>’;
    }
    }
    ?>
    </div>
    </div>
    </div>
    </div>
    <?php get_footer(); ?>

The topic ‘Category problem’ is closed to new replies.