Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • @ian92484

    That works perfectly! Thanks.

    Sorry, missed out the code including neologan’s exmaple in my post above. The code including neologan’s example looks like this:

    '<li><a href="' . get_permalink($post["ID"]) . '" title="Read more of '.$post["post_title"].'" >' . $post["post_title"].'</a> '. mysql2date('j M Y', $post->post_date) .' </li> '

    But outputs:

    <li><a>Title</a> </li>

    I’m trying to get:

    <li><a>Title</a> April 12, 2010</li>

    I’m having the same problem…

    I’m trying to output:

    <li><a>Title</a> April 12, 2010</li>

    But when I use the code in neologan’s example above I get:

    <li><a>Title</a> </li>

    Here’s my code:

    '<li><a href="' . get_permalink($post["ID"]) . '" title="Read more of '.$post["post_title"].'" >' . $post["post_title"].'</a> '.$post["post_date"].' </li> '

    Thread Starter cheezepie

    (@cheezepie)

    OK, I think I’ve worked this out.

    For reference I’m using the following code to display the most recent 3 posts in a side menu on the single post page:

    <h2>Most recent articles</h2>
    <ul>
    <?php global $post;
     $myposts = get_posts('numberposts=3&offset=0');
     foreach($myposts as $post) :?>
       <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php the_time('F jS, Y') ?>
       </li>
     <?php endforeach; ?>
    </ul>

    I’m guessing this is resetting the ID of the currently viewed post to all of the last three, one of which in this case has four comments and hence they are displayed.

    I guess I’ll have to rework my layout so the code above is not run during the loop. Or does anyone know a way of modifying the above so it doesn’t affect the ID of the current post? Thanks.

    Forum: Fixing WordPress
    In reply to: Archives?

    I’m new to WP and am having problems related to this thread.
    Could someone explain how to set up an archive area of a site using WP? I know that by default all posts are in the DB and that they seem to use the index template when a user views them.
    However, I want to use a different template for archived posts. Is this possible with WP?
    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)