WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to make ALL pages static? (5 posts)

  1. sustainable
    Member
    Posted 2 years ago #

    I found this great tutorial about how to create a static front page, and I also learned that it is possible to create additional static pages by making the front page their parent (in the page attributes on the right pane).

    But now I want all pages in my website to be static as well, but for some reason there is one page that keeps having the blog section, even when I make its parent the static front page.

    Is there a way to hideg the "Leave a Reply" box at the bottom of the page for all pages, including that last one?

    If so, how?

  2. tribalNerd
    Member
    Posted 2 years ago #

    Hello sustainable,

    Depending on your theme, the page.php, loop-page.php, sidebar.php or footer.php will have the function 'comments_template' within it.

    http://codex.wordpress.org/Function_Reference/comments_template

    Comment out the line: <?php //comments_template(); ?> and this should shut off the Leave a Reply box for you.

  3. Kevin Muldoon
    Member
    Posted 2 years ago #

    tribalNerd is right - you just need to remove comments from your templates. You won't find the comments template in footer.php though. Simply remove it from page.php (for pages), single.php (for blog posts) and any other custom page templates (e.g. archives.php, sitemap.php etc).

  4. sustainable
    Member
    Posted 2 years ago #

    This is weird: I managed to create all pages static (i.e. no "Leave a Reply" box at the bottom of the page) without modifying any .php code and without making the static front page their parent.

    And one I delete the only page that had that "Leave a Reply" box (the sample page automatically created by WordPress upon install), I got all my pages static.

    What made me think that making the (static) front page their parent is a requirement?

    I still don't what made WordPress behave exactly like I needed. I did uncheck Settings > Discussion > "Allow people to post comments on new articles" prior to creating the new pages. Could that be the reason?

  5. Kevin Muldoon
    Member
    Posted 2 years ago #

    Yes you need to uncheck the discussion option though removing the code from the templates ensures that you don't have to go through old articles and disable comments.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags