• I want to display the single-page entry date (which needs to be inside the loop) on top of the sidebar but when I move the beginning of the loop to the sidebar, the sidebar gets repeated as well which totally screws up the layout. When I put another loop on the sidebar, it just gives me errors.

    Any idea on how to have two loops running on the same page? I’d appreciate your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • http://codex.wordpress.org/The_Loop#Multiple_Loops

    What specific template tag are you trying to use? the_date returns the date for a specific post, so I don’t think it’s going to work for what you want anyway. The reason it needs to be inside The Loop is because it’s specific to a post, so if you create a Loop that has no posts just to show the date, you’re going to get (I would expect) either a null value or an error.

    Are you wanting to show the date of your latest post? If so, you might look through any of the recent post plugins and see if one of them would be useful.

    Thread Starter happy

    (@happy)

    I’ve tried all the tricks on the Multiple Loops page but nothing worked. The code I want to run on the sidebar is the following:

    <h2 class="entry">About This Entry</h2>
    You are currently reading a <a>"><?php echo bloginfo('name'); ?></a> entry posted on <?php the_time('l, F jS, Y'); ?>

    I don’t think it should be this difficult. It’s for the single entry page.

    You might modify the title of your post here to something like “Getting post date on sidebar of single entry page”. A title that has a whole page devoted to it in the codex can get overlooked pretty easily. Sorry, I don’t have any better suggestion, other than looking for a plugin.

    Thread Starter happy

    (@happy)

    That’s alright. Thanks for trying.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Running two loops on one page’ is closed to new replies.