• Resolved mariannehalavage

    (@mariannehalavage)


    How do I remove the date stamp from posts?
    I use the black pink theme. https://newwpthemes.com/demo/BlackPink/

    I went into single post template and deleted the line <div class=”postdate”><img src=”<?php bloginfo(‘template_url’); ?>/images/date.png” /> <?php the_time(‘F jS, Y’) ?>

    But it hasn’t worked.

    Here is the full code.

    Ideas most welcome.

    <?php get_header(); ?>
    <div class=”span-24″ id=”contentwrap”>
    <div class=”span-16″>
    <div id=”content”>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
    <h2 class=”title”><?php the_title(); ?></h2>
    <div class=”postdate”><img src=”<?php bloginfo(‘template_url’); ?>/images/date.png” /> <?php the_time(‘F jS, Y’) ?> <img src=”<?php bloginfo(‘template_url’); ?>/images/user.png” /> <?php the_author() ?> <?php if (current_user_can(‘edit_post’, $post->ID)) { ?> <img src=”<?php bloginfo(‘template_url’); ?>/images/edit.png” /> <?php edit_post_link(‘Edit’, ”, ”); } ?></div>

    <div class=”entry”>
    <?php if ( function_exists(“has_post_thumbnail”) && has_post_thumbnail() ) { the_post_thumbnail(array(300,225), array(“class” => “alignleft post_thumbnail”)); } ?>
    <?php the_content(‘Read the rest of this entry »’); ?>
    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
    </div>
    <div class=”postmeta”><img src=”<?php bloginfo(‘template_url’); ?>/images/folder.png” /> Posted in <?php the_category(‘, ‘) ?> <?php if(get_the_tags()) { ?> <img src=”<?php bloginfo(‘template_url’); ?>/images/tag.png” /> <?php the_tags(‘Tags: ‘, ‘, ‘); } ?></div>

    <div class=”navigation clearfix”>
    <div class=”alignleft”><?php previous_post_link(‘« %link’) ?></div>
    <div class=”alignright”><?php next_post_link(‘%link »’) ?></div>
    </div>

    <?php if ((‘open’ == $post-> comment_status) && (‘open’ == $post->ping_status)) {
    // Both Comments and Pings are open ?>
    You can leave a response, or ” rel=”trackback”>trackback from your own site.

    <?php } elseif (!(‘open’ == $post-> comment_status) && (‘open’ == $post->ping_status)) {
    // Only Pings are Open ?>
    Responses are currently closed, but you can ” rel=”trackback”>trackback from your own site.

    <?php } elseif ((‘open’ == $post-> comment_status) && !(‘open’ == $post->ping_status)) {
    // Comments are open, Pings are not ?>
    You can skip to the end and leave a response. Pinging is currently not allowed.

    <?php } elseif (!(‘open’ == $post-> comment_status) && !(‘open’ == $post->ping_status)) {
    // Neither Comments, nor Pings are open ?>
    Both comments and pings are currently closed.

    <?php } edit_post_link(‘Edit this entry’,”,’.’); ?>
    </div><!–/post-<?php the_ID(); ?>–>

    <?php comments_template(); ?>

    <?php endwhile; ?>

    <?php endif; ?>
    </div>
    </div>
    <?php get_sidebars(); ?>
    </div>
    <?php get_footer(); ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • I would not remove the div class portion of that line of code, just the date stuff inside, or your layout will break

    <img src="<?php bloginfo('template_url'); ?>/images/date.png" /> <?php the_time('F jS, Y') ?>

    just that should be removed. Now, you pulled that from single.php, so it will only remove the date from the single post view. You also have index.php (post list/blog view) and page.php (page view) as a minimum to edit

    you may need to do the same in index.php (and maybe more template files), not just in single.php

    just delete exactly this:
    <img src="<?php bloginfo('template_url'); ?>/images/date.png" /> <?php the_time('F jS, Y') ?>

    (don’t delete this <div class="postdate"> as it may otherwise break your design)

    edit:
    getting too slow for this … need a break. lol

    Thread Starter mariannehalavage

    (@mariannehalavage)

    Hi guys,

    Thank you for being so knowledgable.

    I have deleted <img src=”<?php bloginfo(‘template_url’); ?>/images/date.png” /> <?php the_time(‘F jS, Y’) ?> from single post and from index, and saved it. There is no code like this in page.php.

    But I still see the date at the top of each post. Argh.

    Any more ideas?
    M

    link to your site please? So we could inspect and see how its happening?

    Thread Starter mariannehalavage

    (@mariannehalavage)

    Oh I got it. I just deleted that from every template it appeared in! Thank youuuuuuu! Best wishes, M

    You can check Oozman’s Date Remover plugin. https://oozman.com/oozing/ideas/archives/oozman-date-remover-wordpress-plugin

    It works great for me. And I think this plugin works on all of the themes. Maybe you can try it out.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I remove the date stamp from posts?’ is closed to new replies.