WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove date & comments ONLY from pages, not posts? (5 posts)

  1. Mad Metal
    Member
    Posted 5 years ago #

    Okay, what I want to do is remove the date the page was published as well as the bar that indicates who it was published by and how many comments, etc. ONLY for my pages (not blog posts). I mean I know how to remove it all together, however I want the date and the rest of that good stuff on there for my blog posts.

    Example: http://immortalhulkhogan.com/main/?page_id=413
    ^^ as you can tell, that is supposed to be used as a regular webpage WITHOUT the date and comment stuff on the bottom of the page.

    http://immortalhulkhogan.com/main/?p=770
    ^^ actual blog posts (not pages) like these I want to keep the date stamp as well as the comment stuff.

    I really need to know a way to fix this.

    Thanks

  2. stvwlf
    Member
    Posted 5 years ago #

    Does you theme have a page.php template file?
    /wp-content/themes/{themename}/

    If yes, remove what you don't want on pages from that template. make a backup copy before making your changes.

    If there is no page.php in your theme, create one by making a copy of the theme's index.php page and saving it as page.php in the theme folder. Then you can remove all the information you don't want displayed on pages.

    The page.php template file is only used on pages, so you don't need to be concerned about affecting your posts page when you make changes to it.

  3. Mad Metal
    Member
    Posted 5 years ago #

    Awesomeness! Tried it and it worked. Thanks a bunch man!

  4. englishlangprof
    Member
    Posted 5 years ago #

    WOW! Searched for ages for an answer to this question. stvwlf gets the plain English award at wordpress for this simple straightforward explanation!
    Thanks!

  5. KathleenH
    Member
    Posted 4 years ago #

    Wow, this is genius! Thank you for posting this solution - it worked beautifully for me and saved me a lot of angst.

Topic Closed

This topic has been closed to new replies.

About this Topic