treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Wordpress newbie question on the comments.php file

  • Hi,

    Sorry if this is a basic question but I'm struggling with the following.

    I want to create for the most part a static site in WP. The trouble is that when I add content to static pages I still get the following attached with the text - "By admin, June 12, 2009 7:36 am"

    What line of code do I need to remove from the comments.php that hide's that info?

    Link to my test site: http://keithlogan.co.uk/wordpress/

    Thanks
  • You aren't using static pages you are using post pages which is something completely different.
    I've just done a quick search and found this video which may help to explain http://wordpresstraining.com/videos/blogging/creating-content-in-wordpress-posts-vs-pages/
  • You don't want to change comments.php. Assuming you are using pages, they are displayed using the page.php template. All you have to do is look for a section that starts <div class="authormeta"> and remove that entire <div> from the template (including the closing </div>).

    If you don't wish your pages to have comments then you can turn comments off in the Edit Page screen under Discussion.
  • Hi

    I'm not sure which options I need to turn off in the Edit Page screen under Discussion, please see my attached screen grab of the options I have selected.

    Thanks
  • Those are the default settings for new posts. If you want to change the settings of existings posts/pages you need to edit the page and change the discussion settings on a per page basis.

    http://farm4.static.flickr.com/3353/3635508254_52268aa514_o.jpg
  • Hi

    I've created a new page making sure that 'Allow Comments' and 'Allow Pings' are switched off.

    I still get the following on the new page:

    By admin, June 17, 2009 5:35 am

    Comments are closed


    I'm missing something here? Sorry.

    Link to new page: http://keithlogan.co.uk/wordpress/?page_id=17
  • Which template are you using? Static pages should use page.php if it exists.
  • I'm using Panorama.

    It does have a page.php file
  • Check this thread http://wordpress.org/support/topic/273815
  • thanks for the link.

    I've now managed to get rid of the Admin text, however the main text of my new page doesn't display at all - I only see 'comments are closed'?

    http://keithlogan.co.uk/wordpress/?page_id=23
  • Ok, I've just downloaded the Panorama theme. Pretty weird! Whoever built it obviously doesn't know the difference between a page and a post.
    Now I haven't tested this because I really can't be bothered to add it to any of my local copies of WP, but I'm pretty sure that your page.php should look like this:
    <?php get_header(); ?>

    <div id=\"content\">
    <div id=\"content-inner\">

    <div id=\"main\">

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class=\"post\" id=\"post-<?php the_ID(); ?>\">


    <h2><?php the_title(); ?></h2>

    <div class=\"entry\">

    <?php the_content(__('Continue reading','panorama') . ' &#39;' . get_the_title('', '', false) . '&#39;&raquo;'); ?>
    <div style=\"clear:both\"></div>
    </div>


    </div>




    <?php endwhile; ?>



    <div id=\"navigation\">
    <div class=\"fleft\"><?php next_posts_link(__('&laquo; Older', 'panorama')) ?></div>
    <div class=\"fright\"> <?php previous_posts_link(__('Newer &raquo;', 'panorama')) ?></div>
    </div>



    <?php else : ?>

    <div class=\"post\">
    <div class=\"entry\">
    <h2><?php _e('Not Found','panorama'); ?></h2>
    <p><?php _e('Sorry, you are looking for something that isn\'t here.','panorama'); ?></p>
    </div>
    </div>


    <?php endif; ?>



    </div> <!-- eof main -->

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>
  • It shows the following for me :mrgreen:


    New page 2

    testing new page in WP
  • "davesgonebananas" said:
    It shows the following for me :mrgreen:


    New page 2

    testing new page in WP

    Probably because he's switched back to the default theme. :D