WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove Dates from Archived Posts (14 posts)

  1. JG99
    Member
    Posted 4 years ago #

    Hello, I want to remove the dates from archived posts. Here is the archive.php file:

    <h2 class="pagetitle"><?php printf(__('Archive for the ‘%1$s’ Category'), single_cat_title('',false)); ?></h2>
    <?php endif; ?>

    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2 class="pagetitle"><?php printf(__('Archive for %1$s'), get_the_time(__('F jS, Y'))); ?></h2>

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2 class="pagetitle"><?php printf(__('Archive for %1$s'), get_the_time(__('F, Y'))); ?></h2>

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2 class="pagetitle"><?php printf(__('Archive for %1$s'), get_the_time('Y')); ?></h2>

    Do I remove code starting from [get_the_time] until the final [)]?

    Thank you for your help.

  2. MichaelH
    Member
    Posted 4 years ago #

    That probably isn't the right code you want to change if you are wishing to no longer display the date with each post.

    Look for something like 'the_date' or 'the_time'.

  3. JG99
    Member
    Posted 4 years ago #

    MichaelH, is the key in the [Hack. Set $post so that the_date() works.] section?

    I have been able already to turn off the date on current posts, I am concerned now with the archives.

    Thanks for your help, sorry to post so much code. How can I post code in a neater fashion?
    --------------------------------------------------------

    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

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

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>

    <?php if (function_exists('lang_picker_respect_more')) : ?>
    <h2 class="pagetitle"><?php printf(__('Archive for the ‘%1$s’ Category'), lang_picker_respect_more(single_cat_title('',false))); ?></h2>
    <?php else : ?>
    <h2 class="pagetitle"><?php printf(__('Archive for the ‘%1$s’ Category'), single_cat_title('',false)); ?></h2>
    <?php endif; ?>

    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2 class="pagetitle"><?php printf(__('Archive for %1$s'), get_the_time(__('F jS, Y'))); ?></h2>

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2 class="pagetitle"><?php printf(__('Archive for %1$s'), get_the_time(__('F, Y'))); ?></h2>

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2 class="pagetitle"><?php printf(__('Archive for %1$s'), get_the_time('Y')); ?></h2>

    <?php /* If this is a search */ } elseif (is_search()) { ?>
    <h2 class="pagetitle"><?php _e('Search Results'); ?></h2>

    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2 class="pagetitle"><?php _e('Author Archive'); ?></h2>

    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <h2 class="pagetitle"><?php _e('Blog Archives'); ?></h2>

    <?php } ?>

  4. MichaelH
    Member
    Posted 4 years ago #

    Please provide a URL to show the problem and give an example of what you want removed.

  5. JG99
    Member
    Posted 4 years ago #

    http://themes.jillij.com/category/themes/

    Michael, you can see where it says "Jillij version 14" and then below that it says "Sunday, July 6th, 2008"

    I want to remove "Sunday, July 6th, 2008"

    Thank you for helping me.

  6. MichaelH
    Member
    Posted 4 years ago #

    Please paste all the code in that template into a pastebin such as wordpress.pastebin.com, and report the link back here.

  7. JG99
    Member
    Posted 4 years ago #

    Are you saying I should paste the code for the entire theme? Or just for archive.php?

  8. MichaelH
    Member
    Posted 4 years ago #

    Yes, just the archive.php if that is the template that is displaying the view you want to change. See Template Hierarchy to confirm.

  9. JG99
    Member
    Posted 4 years ago #

  10. MichaelH
    Member
    Posted 4 years ago #

    Delete this:

    <small><?php the_time(__('l, F jS, Y')) ?></small>
  11. JG99
    Member
    Posted 4 years ago #

    Michael, it works! Thank you.

    Can I ask one more question?

    You will notice that this theme has a drop-down menu. I would like the menu to be at the top of the photo, rather than at the bottom. Can you help me change that?

  12. MichaelH
    Member
    Posted 4 years ago #

    Better to start a new topic with that question.

  13. JG99
    Member
    Posted 4 years ago #

    Here's the header file link:

    http://wordpress.pastebin.com/NsiUqWg8

    And here's the stylesheet file link:

    http://wordpress.pastebin.com/azh6nEap

  14. JG99
    Member
    Posted 4 years ago #

    OK, will do.

Topic Closed

This topic has been closed to new replies.

About this Topic