Buying $10 for Wordpress 3.1 archives.php fix

Discussion in 'Programming' started by aceriker, Apr 6, 2011.

  1. #1
    Hi, I'm trying to create a new theme and am having some trouble getting the archive.php file to display the correct data.

    This is what I want to happen:

    - The archive (eg. April 2011) only shows posts from certain categories
    - The archive page is paginated using WP PageNavi

    This is what is currently happening:

    - The archive is showing posts from certain categories but it is showing for all dates. So the archive page for April 2011 is also showing posts from February 2011 etc.

    I think it needs a fix in the new WP_Query. This is the current code (it's a total hack job!):

    
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	$my_query = new WP_Query("showposts=4&cat=-5,-6,-7,-8,-9&paged=$paged");
    while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;
    ?>
    
    Code (markup):
    And for the pagination:

    
    	<?php
          query_posts('cat=-5,-6,-7,-8,-9' . '&paged=' . get_query_var('paged'));
    ?>
    
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } 
    else { ?>
    <p class="pagination">
        <?php next_posts_link('&laquo; Previous Entries') ?>
        <?php previous_posts_link('Next Entries &raquo;') ?>
    </p>
    <?php } ?> 
    
    Code (markup):
    I can pay $10 by paypal if you can help me fix this code and do what I want it to.

    Thanks,

    Peter
     
    aceriker, Apr 6, 2011 IP
  2. skystudio

    skystudio Well-Known Member

    Messages:
    241
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    well , i sent you the solution some days ago .... not even a thank you .... not cool
     
    skystudio, Apr 7, 2011 IP
  3. qlogixsolutions

    qlogixsolutions Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    PM me if you are still looking for someone to do this for you. I got a clear idea what you want to do and I already have the solution for this.
     
    qlogixsolutions, Apr 8, 2011 IP