WordPress.org

Ready to get started?Download WordPress

Forums

removing date on sticky posts (7 posts)

  1. mographdesigner
    Member
    Posted 4 years ago #

    How do I remove the dates ONLY on my sticky posts? Is there a plugin to do that? Thanks and God bless!

  2. MichaelH
    Member
    Posted 4 years ago #

    <?php
    //if not sticky display the_time  must be in the loop
    if ( !is_sticky() ) {
    the_time();
    }
    ?>

    Related:
    Formatting_Date_and_Time
    the_time()
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  3. AMPSound
    Member
    Posted 3 years ago #

    Can you please give us more info on these instructions? Where do you put this code?

  4. chaitanya74
    Member
    Posted 3 years ago #

    Try to use this plugin. You can exclude date coming in various posts and pages.
    http://www.dailyblogtips.com/date-exclusion-wordpress-plugin/

    Or else another alternative is, you need to edit single.php and index.php

  5. keesiemeijer
    moderator
    Posted 3 years ago #

    look in your theme's index.php and see if you find some time related code simular to :
    <small><?php the_time('F jS, Y') ?> </small>
    put this line in the code MichaelH gave you, like so:

    <?php
    //if not sticky display the_time  must be in the loop
    if ( !is_sticky() ) : ?>
    <small><?php the_time('F jS, Y') ?> </small>
    <?php endif; ?>
  6. AMPSound
    Member
    Posted 3 years ago #

    Amazing! That worked! Thanks keesiemeijer!

  7. keesiemeijer
    moderator
    Posted 3 years ago #

    Glad you got it working! Now, please use the dropdown at top right to mark this topic 'Resolved'.

Topic Closed

This topic has been closed to new replies.

About this Topic