The MU forums have moved to WordPress.org

Display Author+Date only for posts in 1 single page template (4 posts)

  1. mattgreen
    Member
    Posted 16 years ago #

    Hi All,
    First off sorry as I am a bit of a noob when it comes to coding with wordpress.

    I am currently running a free theme template with wordpress and am slowely teaching myself how it all works by editing it as I need to, but I have come to a bit of a hurdle that I haven't been able to find a solution for.

    The theme I am using only uses one template for both single pages and templates. Currently author and date's appear for pages also. I would like to be able to modify this so that it only displays the 'author' and 'date' fields in the template if it is a post, and not a page.

    Is there some sort of function I can use to have it check if the content is a page or post and wrap a <?php if ( around the calls for date & author??

    Appreciate any help.

    cheers

  2. andrea_r
    Moderator
    Posted 16 years ago #

    make a copy of the template, cal it page.php. edit that with what you want for the pages-only.

  3. kgraeme
    Member
    Posted 16 years ago #

    Learn to love the Template Hierarchy.

  4. mattgreen
    Member
    Posted 16 years ago #

    wow I totally over thought this one.
    Thanks for that andrea & kgraeme!

About this Topic

  • Started 16 years ago by mattgreen
  • Latest reply from mattgreen