I am trying to display posts in a way where the sidebar displays the excerpts of two recent posts and the middle of the page displays the full post when the post in the sidebar is selected. I have been able to do this by modifying the ‘single.php’ file.
However I don’t know how to exclude the post in the middle from the sidebar?
Can anybody point me in the right direction on how to do this?
I’ve figured out what I think is the best way to approach it but I still need help with its completion:
I use: <?php query_posts(array('category_name' => 'news', 'post__not_in' => array(31))); ?>
This would exclude, in this instance, the post with the ID of 31.
So now I need to make it dynamic. My knowledge of php isn’t great, but I thought declaring a variable of the current post would work, so something like: