• Hey

    I recently modified Categories.php for a friend’s website. The website is using the Twenty Twelve theme that I have customised to his specifications. I modified Categories.php in the following way:

    <?php
        $i = 0;
    
        query_posts($query_string.'&posts_per_page=10');
    
        /* Start the Loop */
        while ( have_posts() ) : 
    
        the_post();
        $post = get_post(get_the_ID());
    ?>
    
    <div class="custom-archive-item" style="<?php if($i == 0 || $i == 2 || $i == 4) echo "border-bottom: none;"; // awesome hacks ?>">
    
        <h1 class="custom-archive-h1">          <a href="removed"><?php echo $post->post_title; ?></h1></a>
        <div class="custom-archive-date">       <div class="custom-archive-label"><p>Posted on:          </p> </div><?php echo the_time("F dS Y"); ?></div>
        <div class="custom-archive-thumb">      <p><?php echo_first_image(get_the_ID()); echo get_the_excerpt(); ?></p></div>
        <p>?</p>
        <?php $i++; endwhile; ?>

    Every time a user clicks on an “archive” link, for example “June”, it won’t just show posts from that month, but posts from the beginning of time.

    Could anybody help please? see the website at: https://www.nbanewssource.com the archive links are in the sidebar.

    Thank you.

Viewing 1 replies (of 1 total)
  • Thread Starter George88

    (@george88)

    Is there any way to include in the get_post() function a parameter that selects only the posts with the date in the URL?

    There must be a solution to this.

    N.B. This is already on page 11 after 5 hours. How busy is this forum?!

Viewing 1 replies (of 1 total)
  • The topic ‘Modified Categories.php, now displays wrong posts’ is closed to new replies.