• Hello,
    Does anyone know how I can remove the automatically-generated date and time “posts” on the static pages. I want that info on my actual post pages; just not the static pages.
    Thanks,
    Colleen Robledo

Viewing 9 replies - 1 through 9 (of 9 total)
  • In your themes files, found under wp-content/themes/[the name of your current theme]/ you should see a page.php file. Edit it and remove either the_date or the_time function calls.

    Thread Starter colleenrobledo

    (@colleenrobledo)

    Will this remove the date/time on my post pages as well, or just the static pages? Thanks!

    Read: https://codex.www.ads-software.com/Template_Hierarchy
    (your posts are NEVER displayed by the page.php template file!)

    Thread Starter colleenrobledo

    (@colleenrobledo)

    I’m using the Gentle Calm theme, and I don’t find any file anywhere in this theme, the wp-content directory, or the main wp directory titled “page.php”.

    In that case, make one by copying index.php as page.php, then deleting the calls to … etc.

    Thread Starter colleenrobledo

    (@colleenrobledo)

    The index.php file under this particular theme doesn’t appear to call in any pages, just posts… so I’m not sure how to modify the calls to function for pages w/o modifying it for all the posts. Thanks.

    \

    <?php
    get_header();
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”entry”>
    <h2 class=”entrydate”><?php the_date() ?></h2>
    <h3 class=”entrytitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark”><?php the_title(); ?></h3>
    <div class=”entrybody”>
    <?php the_content(__(‘(more…)’)); ?>
    <p class=”comments_link”>
    <img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/file.gif” title=”file” alt=”*” />
    <?php _e(“Filed by”); ?> <?php the_author();?> <?php _e(“at”);?> <?php the_time() ?> <?php _e(“under”);?> <?php the_category(‘,’);?><br/>
    <?php
    $comments_img_link = ‘<img src=”‘ . get_stylesheet_directory_uri() . ‘/images/comments.gif” title=”comments” alt=”*” />’;
    comments_popup_link(‘No Comments’, $comments_img_link . ‘ 1 Comment’, $comments_img_link . ‘ % Comments’);
    ?>

    </div>
    <!–
    <?php trackback_rdf(); ?>
    –>
    </div>

    <?php comments_template(); // Get wp-comments.php template ?>

    <?php endwhile; else: ?>
    <?php _e(‘Sorry, no posts matched your criteria.’); ?>
    <?php endif; ?>

    <?php posts_nav_link(‘ — ‘, __(‘« Previous Page’), __(‘Next Page »’)); ?>
    </div>
    </div><!– The main content column ends –>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    \

    Just read carefully the instructions filosofo gave you. Don’t worry about the “posts” vs. Pages. (for this issue)

    Save it as page.php, which means you’ll have 2 files:
    index.php AND page.php

    Edit the page.php – remove what you don’t need in Pages: date and time tags, call for comments_template etc.

    Thread Starter colleenrobledo

    (@colleenrobledo)

    Got it. That does make sense. Will give it a try. Thanks!

    Thread Starter colleenrobledo

    (@colleenrobledo)

    Worked great! Thanks so much!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove date/time on static pages’ is closed to new replies.