Support » Theme: OnePress » Add date of post to category page?

  • dethompsOWU

    (@dethompsowu)


    Is there a way to add the date a post was made to a post category page ([SITE]/category/[CATEGORY SLUG])? I don’t see any pertinent options in the Customizer, but figured I’d ask in case I’m overlooking something.

    Basically, we want to be able to see when a post was made when there’s a long list of posts without having to click to go into each individual post (which already lists the date/author for the post, which is fine.

    FYI, we only want the date out on the “list of posts” page…no need for the author to go out there. Really, in an ideal world, we could get rid of the author info from the individual post pages as well, so if there’s a related way to do that, let me know.

    Thanks,

    Doug Thompson
    Manager of Web and Electronic Communications
    Ohio Wesleyan University

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    By the default, the theme does not support to show the time of the post in the list posts. I can help you to use the child theme to override the template of the theme to show the time, please follow step by step:

    1. Install, activate the child theme (you may need to copy the settings of the customizer from the parent theme to the child theme) by following this document
    https://docs.famethemes.com/article/139-sample-child-theme

    2. Copy folder “template-parts” and file “content-list.php” from the parent theme to the child theme folder.

    3. Edit the file “content-list.php” in the child theme folder, put this code to the end of line 48
    <p><?php the_date('F j, Y'); ?></p>

    Ok, save this file and check the category page.

    Regards.

    Luckily, we already were doing the “child theme” thing, so really I only had to do #2 and #3 in your suggestion.

    Regardless, it worked perfectly. Thanks!

    And now for a complication…is it possible to not show the date of posts on the homepage but show them on the other pages of the site?

    Hi,

    Please replace the code above with this code

    <p><?php if( !is_front_page() ) { the_date('F j, Y'); } ?></p>

    Regards.

    Perfect…that worked exactly how I was hoping it would. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.