I want to start a funny images website but I have come across a dilemma. I want the website to display 1 post ( not the thumbnail) but the full post on the home page. (the most recent post). Similar to jokideo can anyone please direct me to a theme
or provide some code that I need to edit in the wp theme files.
Thanks 🙂
It depends on what theme you use as they are not coded the same.
Use
pre_get_posts
or the reading settings andthe_content()
rather than the_excerpt() in your loop.Or you could redirect the latest single post to display on the home page.
Create a page template with this code between header and footer:
Then create a new page, select this template and save it. Now in Settings > Reading, select the option “static page” and define the page created as “Front page”.
Also, create a new white page with the blog name —for example— and save it. In Settings > Reading, define this page as “Posts page”. Now we have the last post in the front page and all the posts in a blog page.
But we still need to exclude the last post in the loop, in order to avoid duplicate content. You will probably find the loop in the file
index.php
orloop.php
.Find this line:
And add these lines overriding the last one:
I would recommend altering the loop that displays the home page posts. Something like
There probably are better and more elegant solutions to this, but this is quite simple to implement.
You can edit the file responsible for displaying front page posts (index.php in the twentytwelve theme ), but I wouldn’t recommend this seeing that it might be overwritten when updating. It will be better to use a custom theme, maybe a child theme, or to use a custom template file for the front page