Using WP as CMS but need posts on home page (4 posts)

  1. foxden vixen
    Posted 4 years ago #

    I have been working on my own WP theme and site for a client. He is using this as a CMS more than a blog. However, on the home page I would like recent entried that he has made on other pages showing there. Is this done with the loop and if so what code do I need to use to get this to work?

    The site can be seen at http://foxdenwebsolutions.com/test. If he makes and entry on the workplan page, I want an excerpt to show on the home page.

    Here is the code -

    Home page template

    two-column-page template


    The index.php page really should not be used. I don't have the loop working in that file.

  2. Red Deer Web Design
    Posted 4 years ago #

    I don't quite understand. It appears that you have a loop in your home page template to display recent posts. Is this not the desired action already?

    if you want excerpt, make sure you're using excerpt and not get content.

  3. zartgesotten
    Posted 4 years ago #

    If I'm not mistaken you could use another template-file called front-page.php and put your loop in there.

    And of course you will have to change the settings in your wordpress to display the latest post on the front page. You'll find that under Options-reading (I think that's the English term) in case you didn't know.

    In cases like yours I use page.php for my CMS pages which leaves index.php for stuff like blog posts on front page.

    Good luck

  4. foxden vixen
    Posted 4 years ago #

    Now I am not sure this is going to work correctly. Since the About Us page has a video that pulls to the home page and I don't want that. I have the loop in both home and two-column page templates. When I change the settings for reading I set the posts to be on the home page and WP yells at me that it can't be the same as the static page. Hmmm I may need to rethink this. I guess the client could manually type in what new posts he as made.

Topic Closed

This topic has been closed to new replies.

About this Topic