Modified date on post

Hi there,

I have applied the css code below to have modified dates appear on posts:

time.updated:not(.published) {
display: inline;
}
time.updated:not(.published):before {
font-family: FontAwesome;
content: “\00a0\f2f1”;
}

I wonder if it is possible to have modified dates appear ONLY when the posted date and the modified date are different.

For example, the post below has the same date both for the posted date and the modified date, which is redundant, and I would like to remove the modified date in this case.

(Please delete the space between “com” and “/” in the URL below )
https://suzuki-akiko.com /6050/

Thank you in advance for your reply.
Kind regards,

Hello,

First thanks for using our Sydney theme!

With custom JS code we can do that, please follow the steps beow:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box

(function($){
    
    if( $('article.post').length ) {
        $('article.post').each(function(){
            var published_time = $(this).find('time.published').text(),
                updated_time   = $(this).find('time.updated').text();

            if( published_time == updated_time ) {
                $(this).find('time.updated').remove();
            }
        });
    }

}(jQuery))

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo,

It worked perfectly!
Thank you :slight_smile:

I also would like to make a small change in the way the modified date appears on the post: how can I have a space between the Font Awesome (f2f1) and 2021?

Warmly,

Hello,

Great!

Regarding your new question, in the same place where you added the custom CSS for the icon, change the code to:

image

Note the margin left and right. This will create a space in both sides.

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo,

Thank you again for your help.
It works great and the dates on the post look perfect now :slight_smile:

I love your Sydney theme.
Let me add one more issue to see if it is within the scope of your support team: The main page of the theme has a full-screen-size image for the slider. Mine seems too heavy to upload smoothly. When I reduced the size of the photo, the quality also decreased and the photo did not look clear enough. Is there anyway that I can reduce the heaviness of the photo while maintaining the quality of it?

If this is something that I can get your help for, I should create a new topic, I suppose.

Kind regards,

Hello,

Great that the issue with icons is resolved now and thanks for the kind words about our theme!

My suggestion for you is try using a service like https://tinypng.com/ to compress the image and reduce the size even more.

We hope this helps!

Please try that and let us know if you need further assistance.

If you are satisfied with our theme and support, would be great if you leave your comment and rating in the offical WordPress Themes repository. That helps us a lot: https://wordpress.org/support/theme/sydney/reviews/#new-post

Kind Regards,

Rodrigo.

aThemes Support

1 Like