Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #130518
    KMZ_FN
    Participant

    Hey there!

    Well… the title says it all^^
    Is that possible? (I found some tuts in a different language, but it’s not working)

    I know that -usually- it’s not intended to be, but maybe you have some tutorial around how I could modify the page.php
    to display a static content on top, like a regular page, and underneath show all (or a fixed number) of recent posts.

    suggestions?

    Cheers,

    Fred 🙂

    #130568
    tikaram
    Participant

    @kmz_fn : You will need to get your site customized to get the desired results. I suggest you to hire a customizer to get your site customized as it involves making changes on your site files and customizing your site with a child theme. Let me know if you have any more there related issues.

    Regards,
    Tikaram

    #130687
    KMZ_FN
    Participant

    well, I almost got the desired result myself… the only remaining question would be:
    how does the theme gather the posts – where is the routine used for doing this?

    I have a static page now with a number of posts underneath, it just does not display the
    same way as the theme usually does, and I’d like to use the same ‘style’ it did before.

    #130737
    KMZ_FN
    Participant

    got it working myself 🙂

    if anyone’s interested:

    – (better) get a child theme first, it’s working without… but you wont do any damage like that, so better set up a child first
    – get a copy of this code https://pastebin.com/JjkBHR42 and save it as pagewithnews.php into your child theme’s directory.
    this will furtheron act as your template to display static content AND news on your front page.
    it’s configured to display the last 10 posts, but you can of course change this.
    – create a simple page (insert some content) and set it up as your ‘home’page (setting -> reading -> set up as static page -> select this page you’ve just created)
    – go to pages to quick edit this ‘home’page and assign the above created template (pagewithnews.php to it)

    you now should see a static page with the contect you’ve inserted, and underneath the posts should be shown (in case you have some^^)

    that’s it 🙂

    #130739
    KMZ_FN
    Participant

    one slight change to the code. the code above only displayed the very last single post, this one will display the last 10.

    https://pastebin.com/cBVewrkD

    cheers!

    #130756
    tikaram
    Participant

    @kmz_fn : Glad to know that you have got the desired output. Thank you for providing the code.

    Regards,
    Tikaram

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Static Page (Home) & Posts underneath’ is closed to new replies.