- This topic has 10 replies, 3 voices, and was last updated 10 years, 6 months ago by
Tom.
-
AuthorPosts
-
May 19, 2015 at 2:00 am #108797
Sander van der Harst
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
May 19, 2015 at 8:21 am #108893Tom
Lead DeveloperLead DeveloperBy 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 🙂
May 20, 2015 at 6:12 am #109111Sander van der Harst
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?
May 27, 2015 at 2:24 pm #110768Tom
Lead DeveloperLead DeveloperSorry 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! 🙂
June 1, 2015 at 1:56 am #111725Sander van der Harst
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
June 1, 2015 at 8:54 am #111774Tom
Lead DeveloperLead DeveloperI’ll be here! 🙂
September 10, 2015 at 8:50 am #135842Austin
I tried the above code but it’s showing up on top of each post instead of just the top of the homepage?
September 10, 2015 at 9:37 am #135864Tom
Lead DeveloperLead DeveloperIs the “Execute PHP” checkbox checked?
September 11, 2015 at 2:22 am #135981Austin
Yes Tom (thanks for fast reply).
September 11, 2015 at 2:59 am #135993Austin
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.
September 11, 2015 at 9:06 am #136054Tom
Lead DeveloperLead DeveloperThe 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.
-
AuthorPosts
- You must be logged in to reply to this topic.