Remove the posted date only (the modified date should stay)

Hello,

I tried a few codes suggested in other topics, but they did not work.

Currently, I have two dates on blog pages, namely, the posted date and the modified date.

I have two requests for you:

  1. I would like to remove the posted date so that only the modified date appears. What code will do this?
  2. Is it possible to insert “最終更新日” (it means the modified date) between the icon (FontAwesome) and the date?

FYI, you could have a look at one of the blog pages below:
(Please delete the space between “com” and “/” in the URL below )

https://suzuki-akiko.com /6516/

Thank you for your support.
Best regards,

Hello,

First thanks for using our theme!

I see you already have a JS code for it, but it’s throwing an error in the browser console. Please try changing the entire JS code to:

window.onload = function() {

    (function($) {
        if( $('.single-meta .posted-on').length ) {
          $(".single-meta .posted-on").each(function() {
            var tmp = $(this).children().remove(); 
            var text = $(this).text(); 
            text = text.replace(/投稿日:/g, ""); 

            $(this).text(text); 
            $(this).append(tmp); 
          });  
        }

        if( $(".single-meta .byline").length ) {
          $(".single-meta .byline").each(function(){
            $(this).find('a').attr('href', 'https://suzuki-akiko.com/プロフィール/');
          });  
        }

      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 help.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo,

Thank you for getting back to me with the code.
I deleted the all the JS codes that I had already applied and tried the code you gave me.
Unfortunately, it did not work.
The blog page still have both the posted date and modified date.

It seems that your code does the following, but I did not clearly request this point in my original post, so let me clarify. I like to have posted dates appear when no modification is made. When the posted date and the modified date are the same date, only the posted date should stay. When the posted date and the modified date are different, only the modified date should stay.

Also, if possible, I would like to have “最終更新日” (it means the modified date) between the icon (FontAwesome, fa-refresh) and the date.

I hope the above makes things clearer.
Thank you for your support in advance and kind regards,

Hello,

At really the code is already doing what you say, the real problem is that error in the browser console:
image

But the strange is that the jQuery is included in the page:

In this case my suggestion for you is install this plugin Health Check & Troubleshooting – WordPress plugin | WordPress.org and enable the Troubleshooting Mode. With plugin activated go to Admin Dashboard > Tools > Site Health and enable the troubleshooting mode by clicking in the blue button.

This way your website will “reset” by disabling all plugins and the active theme. But note this occurs only for logged users. Then, activate the Sydney theme again, the plugins Elementor or Site Origin page Builder (check which you are using), Sydney Toolbox and TC Custom Javascript. Then test if the problem still persists. If it works, then some other plugins it’s causing the issue. So you can enable the plugins one by one to discover what’s the plugin causing the issue.

We hope this helps!

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

Kind Regards,

Rodrigo.

aThemes Support

Hello again,

In your first response in this topic, you wrote “I see you already have a JS code for it”, but what I request in this topic is different from what I requested in the topic below, where I got the original code. In the topic below, I wanted to have both a posted date and a modified date on a blog page.

This time, I want to have either a posted date OR a modified date (NOT both).
May I ask if this point is considered into the JS code you provided in this topic?

Regarding the error in the browser console, it seems that things are beyond my capabilities.
I will think how to go about it.

Kind regards,

Hello,

The JS code is already doing that. Here’s the code part of code that does that:

image

As I mentioned in my previious reply, there’s a strange jQuery error in the browser console (even with the jQuery script included on the page). I think some extra plugin can be the culprit of that issue. So for now, my suggestion is enable the troubleshooting mode as I mentioned here: Remove the posted date only (the modified date should stay) - #4 by rodrigo

Please try that and let us know how it goes.

The purpose is keep a installation only with Sydney related plugins (none extra plugin should be activated, except the TC Custom Javascript).

Kind Regards,

Rodrigo.

aThemes Support

Hi Dodrigo,

I tried the plugin Health Check & Troubleshooting.

What I did in troubleshooting mode:

  1. The Sydney theme was automatically on. I guess that I did not have to activate the Sydney theme because the Sydney is the only theme I have downloaded.
  1. I activated the plugins such as Sydney tool box and TC Custom Javascript. I do not have the plugins Elementor or Site Origin page Builder.

Then, the site looks as below.

I wonder what to do.
Thank you for your further support in advance,

Hello,

In this case we will need investigate the code directly from your site. Thus I request sharing your website’s temporary admin login link and send it privately to me over email. You can generate the link with this plugin .
rodrigo@athemes.com

P.S.: Ensure the link expiry is set to 7 days and all admin rights are enabled.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo,

As requested, I generated the link and sent it privately to your email address by using the plugin you recommended.

Thank you for your support,

Hello,

Thanks!

However, I checked my email inbox now and didn’t received the email. Could you please check if you sent to the correct email?

rodrigo@athemes.com

Kind Regards,

Rodrigo.

aThemes Support

Hello Rodrigo,

I thought that the link would be sent to your email address automatically, which was wrong.
I sent it to you just now.
I hope you will find it in your email inbox.

Kind regards,