WordPress.org

Forums

Use A Static Page And A /blog page (7 posts)

  1. adamj3333
    Member
    Posted 2 years ago #

    I am working on developing this site: http://www.deyoungmedia.com

    I would like to use a static page with a link to my blog that I would like to have live at http://www.deyoungmedia.com/blog.

    I created a page called blog and it is pulling my page.php template, but it is not displaying the posts. I thought I could add the loop to that page, but then the loop would display on any page I create and I don't want that.

    Can someone please help?

    Thank you.

  2. dlozupone
    Member
    Posted 2 years ago #

    Have you gone to the Reading settings and set the "Front page displays:" to "a static page" and selected the appropriate pages in the dropdowns?

  3. adamj3333
    Member
    Posted 2 years ago #

    Yes I have done this and have tried every which way possible to get this to work. Any other suggestions?

  4. dlozupone
    Member
    Posted 2 years ago #

    I think I misunderstood your original question.

    Is there a loop at all on the page.php template? Or have you created an individual page.php template for each page on your site and added the content to that template?

    If you are going to use content stored as posts or pages in the wordpress db, the page must have a loop.

  5. adamj3333
    Member
    Posted 2 years ago #

    I have included a loop on the page.php template. There is NOT one on the index.php page though because I want to use that as a static page to jump off to my blog and other sections of the site.

    Any help you could offer would be greatly appreciated.

    Thanks.
    Adam

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    Static pages still need a Loop.

  7. dlozupone
    Member
    Posted 2 years ago #

    Your index.php will still need a loop. The content pulled for that loop is dependent upon which page you are viewing. So, if you are actually viewing the blog index, whether it be the homepage of your site or a different page, your posts will be pulled and rendered in the loop. If you are viewing a different page, then the content for that page will be used in the loop.

    No matter what page template you are using, it must have a loop if you wish to render content from the database. Or a separate mechanism to query the database and display results found.

    I hope that helps.

Topic Closed

This topic has been closed to new replies.

About this Topic