Tag

WordPress

Browsing

Today, We are going to learn update or create the post publish time. We see the post publish date on many blogs the post publish 3 hours ago. So, How we can change the date format something like Converting Timestamp into a time ago on our WordPress blog. I am going to share step by step guide for date change like.

  • a second ago
  • a minute ago
  • a days ago
  • a month ago
  • a year ago

Yes, We can display the date like this on WordPress blog. So, let’s see how we can change the date format like this.

Converting Timestamp into a time ago in WordPress

We can implement this code by plugin or theme. So, let’s see If you want to implement this code by theme then open the functions.php file. If you want to implement this code by plugin hen open the mail file of your plugin. Then after, following the below function for converting the timestamp into a time ago string.

Now, let’s we are going to call the hook for change the publish date of Blog in WordPress.

We have created the hook get_the_date, the_date, the_time, get_the_time for change the WordPress Blog time. Just follow the above code then check the blog time is changed on your site.

If you face any issue or date is not changed like shown in an example please write the comment below.

By default, WordPress does not allow to add shortcodes in the widget. If you want to enable shortcode functionality for Widget then you need to allow shortcode for widget text. So let’s see how to enable shortcodes in WordPress widget. it’s too easy to allow shortcode in a widget. just follow below steps.

Enable Shortcodes in WordPress widget

Open functions.php  From of your current WordPress theme. Then add the below code at the end of the file.

Now add shortcodes as you want on the widget. The shortcodes are working on Widget.

If you face any issue after adding this code then please write the comment.

Many times we get the jQuery is not defined error in WordPress. We got this error because the jQuery is a conflict with another plugins or theme. We face the jQuery is not defined error in some WordPress site. The same code is working on some other WordPress website. So, How we can solve WordPress jQuery is not defined issue by a single line of code.

WordPress jQuery is Not Defined

Whenever you need to written jQuery code in WordPress. You must follow the jQuery noConflict syntax. If you write your code using jQuery noConflict syntax. Then you never get the jQuery is not defined or $ is not defined error. Your jQuery code is working fine on every WordPress sites.

Write the jQuery code with WordPress jQuery noConflict syntax.

So, Write your jQuery code using the above syntax. I hope that code is useful for you.

If you face any issue after using the above code please write the comment below.

We are going to discuss How to properly use jQuery noConflict mode in WordPress. Because Many times we face or jQuery not found an issue in WordPress. So, Today we are going to learn how to write the jQuery code in WordPress.

jQuery noConflict mode in WordPress

So whenever you need to write the jQuery code in WordPress then you should follow the jQuery noConflict syntax. Just follow the below code for writing jQuery noConflict mode syntax.

 

Now, you can write the jQuery code using $ and jQuery. Now you don’t get the $ or jQuery is not defined error on console.

Still, If you face any issue on jQuery in WordPress please write the comment below.