• Resolved eonlova

    (@eonlova)


    Have problem to show posts date.
    Some of them will show up but not all of them. can not see any pattern for this, seems more like it is totaly random.
    Here is some code that I use:

    <?php
    query_posts('cat=4&orderby=date&posts_per_page=3');
    if (have_posts()) :
    while (have_posts()) : the_post();
    $do_not_duplicate[] = $post->ID
    ?>
    
    <div class="newsPost">
    <a title="<? the_title(); ?>" href="<?php the_permalink(); ?>">
    <? the_title(); ?><br />
    <? the_date('Y M d'); ?>
    </a>
    </div> <!-- Closes newsPost -->
    
    <?php
    endwhile;
    else : ?>
    
    <div class="post">
    <h2 class="center">Sidan kan inte hittas</h2>
    <p class="center">Sidan som du letar efter har flyttats eller finns inte.</p>
    </div> <!-- Closes Post -->
    
    <?php
    endif;
    wp_reset_query();
    ?>
    </div>
    
    <div class="press">
    <h3>Middagsfrid i media</h3>
    <?php
    rewind_posts();
    query_posts('cat=6,8&orderby=date&posts_per_page=3');
    if (have_posts()) :
    while (have_posts()) : the_post();
    if (in_array($post->ID, $do_not_duplicate)) continue; update_post_caches($posts);
    $Source = get_post_meta($post->ID, 'Source', $single = true);
    ?>
    
    <div class="newsPost">
    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    <?php the_title(); ?><?php if ($Source != '') echo ", ".$Source ?>
    <br /><? the_date('Y M d'); ?>
    </a>
    </div> <!-- Closes newsPost -->
    
    <?php
    endwhile;
    else : ?>
    
    <div class="post">
    <h2 class="center">Sidan kan inte hittas</h2>
    <p class="center">Sidan som du letar efter har flyttats eller finns inte.</p>
    </div> <!-- Closes Post -->
    
    <?php
    endif;
    wp_reset_query();
    ?>

    This hav been a problem for a long time and I would be pleased if there is anyone who can help me with this.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Postdate won’t show up’ is closed to new replies.