Archived topic
full posts under homepage
10 replies · Started by Sander van der Harst on May 19, 2015
Hello
I want to show under my homepage text (static page) the latest posts. I can't figure out how to do this. I hope you can help me.
If you want I can sent you a prc.
Kind regards,
Sander
By default, WP doesn't allow content to be added to the posts page.
What you can do is use GP Hooks to target the posts page, and add your content that way.
For exmaple, in GP Hooks, add this to the "Before Content" hook:
<?php if ( is_home() ) : ?>
Everything in here will show up on the posts page
<?php endif; ?>
Let me know if that works for what you're trying to do :)
Hi Tom
Thanks for your quick reply
This is almost what I want for the site. Only know With the hooks the text is shown above all posts en pages. I just want one homepage with text. Under the homepage/text I want to show the newest (full) posts. These are short movies.
Maybe you have a solution?
Sorry for not getting back to you sooner! Not sure how I missed this.
The code I provided above should only show up on your posts page.
Make sure you check the "Execute PHP" checkbox within the hook.
Let me know - I'll reply faster this time, promise! :)
Hi Tom
Thanks for your reply and no worries! I fixed it an other way. When I have other questions I will find you ;-)
Sander
I'll be here! :)
I tried the above code but it's showing up on top of each post instead of just the top of the homepage?
Is the "Execute PHP" checkbox checked?
Yes Tom (thanks for fast reply).
Sorry maybe I should have mentioned my home page is showing latests posts not static page, when I switch to static page it works but not if the homepage is set to recent posts.
The below code only works on the posts page, not static pages:
<?php if ( is_home() ) : ?>
Everything in here will show up on the posts page
<?php endif; ?>
If that's not working, you must have some sort of syntax error going on.
Can you paste the code you're using in here? Be sure to highlight it and click the "code" button in the editor.
