Showing the whole last post on homepage
-
Hi everyone,
I’ve been looking for a solution to this problem for a few last hours. All I need is to show the latest post instead of the list of the recent post. I need to show it as normal single post page, including navigation and everything. I failed with all the solutions I found here & on the interwebz.
The only one that at least partly works is this part of code embedded into home.php:<?php
$i=0; // Initialize to Zero;
if (have_posts()) :
while (have_posts()) : the_post();
if ($i==0) {$recentpostid = $post->ID; $i=$i+1;}
endwhile;
endif;
//get only the latest post
$posts = query_posts( ‘p=’.$recentpostid.”‘”);
?>When I enter the page, the article appears in full length – that’s alright. But the navigation (previous + next) leads to another articles, just as if I was viewing one older article.
Can anyone please help me? I’m only partly experienced in PHP.
Sorry for asking this question again, but I just didnt manage to find a working solution for this problem. Thank you everyone.My webpage:
http://blog.matejhejda.net
- The topic ‘Showing the whole last post on homepage’ is closed to new replies.