The post How to Display Today’s Date in WordPress with or Without a Plugin appeared first on PluginsForWP.
]]>If you’re maintaining a dynamic news website or a personal blog, you may want to display today’s date on some sections of your website.
This tutorial will teach you how to show today’s date and current time on your WordPress website.
There are many reasons to display today’s date, and here are the main ones:

Now that we understand when is a good time to display the date, let’s move on to the next section and learn how to do it.
The easiest way to show today’s date is by using a plugin. There are WordPress plugins for everything, and indeed, one to show the date.
From the WordPress dashboard, navigate to Plugins -> Add New and install the WP Date and Time Shortcode plugin.

Once activated, you can start using the plugin with one of its many shortcodes.
For example, to show today’s date, enter the [wpdts-date] shortcode in a Gutenberg shortcode block for your desired page or post and click update.

Then, visit the page to ensure you like the formatted date.

If you want to display the date differently than the existing format, navigate to the Settings -> General page and select your desired format under the Date Format section.

Make sure to verify the new format once you save the changes.
The shortcode above will display the current date with day, month, and year.
However, the plugin comes with many other options and parameters that you can add to the shortcode to customize the displayed date.
Here are some of the most popular shortcodes of the WP Date and Time plugin:
[wpdts] – the main shortcode which works with all attributes[wpdts-date-time] – default date and time format from WordPress general settings[wpdts-time] – default time format from WordPress general settings[wpdts-custom]– custom format using the PHP date and time formatting characters[wpdts-years], [wpdts-year] – 4-digit year e.g. 1999 or 2134[wpdts-year-short] – 2-digit year e.g. 99 or 34[wpdts-months], [wpdts-month] – month as a number (1-12)You can view the complete list on the plugin’s official developer website.
A plugin is not the only way to display today’s date on your WordPress website. You can do it by using a specific theme with a built-in feature or a PHP function.
Because showing the current date and time is an integral part of news websites, many developers built this feature in their news theme.
Here are popular WordPress news themes that include the option to show today’s date:
Enabling today’s date feature is a straightforward and similar process for all of them; you’ll need to find the correct settings on the Customize screen.
Let’s take the EasyMag theme as an example. Once you open the customize screen, navigate to Header -> Header Topbar.
The show today’s date option is hidden by default. Therefore, uncheck the Hide Header Date box to enable it. Once unchecked, the date will be added to the top header bar next to the weather information.

You can also add today’s date with a PHP function if your website is already established with a theme that doesn’t include that feature.
A PHP function is another simple method to add today’s date to your WordPress website.
It is beneficial when developing core files, editing the footer or header, or creating custom plugins or templates.
You can place the PHP code in the correct position of your desired template file. Then, you can access your theme’s files using FTP software or the native WordPress Theme File Editor screen.
Tip: please back up your website before editing core files.
If, for example, you’d like to add today’s date to your website’s header, open the header.php file of your child theme, and place the code below in your desired position:
<?php echo date(get_option('date_format')); ?>

Once saved, visit your website and ensure the date is displayed correctly. To fit your website better, you can also change the date format through the Settings -> General screen.
If you would like to use the PHP code in the frontend and display the date with a shortcode, paste the function below at the bottom of your functions.php file:
// display today's date with a function
function p4wp_show_todays_date_shortcode() {
return date(get_option('date_format'));
}
add_shortcode('todaydate', 'p4wp_show_todays_date_shortcode');
Once saved, use the [todaydate] shortcode with your favorite page builder plugin, Gutenberg blocks, or the classic editor.

The few methods explored above will require you to add a custom plugin or a code to your WordPress website to display today’s date.
However, if you’re already using a page builder plugin, such as Elementor, you can show the date directly with the plugin and skip the extra steps.
Elementor, a popular page builder plugin, simplifies the process by allowing us to display today’s page on any section of our website.
The advantage of using Elementor is that you don’t need to install any additional plugins or custom functions.
Instead, you can easily display today’s date with the dynamic content feature of Elementor Pro.
You can get Elementor Pro from the official website for a total price of $49, or from us, for only $4.99.
Once you have activated Elementor Pro on your website, click on the Edit with Elementor button to open the visual editor screen of your desired page or theme builder section.
Then, drag the text editor or the title widget from the left sidebar to the canvas on the right.
The widgets will be filled with placeholder content that we need to replace with the current date. To do that, click on the dynamic tag icon and select the Current Date Time option under the Site section.

The widget will default display your location’s date and time. To hide the time and keep the date, click on the settings icon and set the Time Format field to none.

Moreover, if you want to add extra text before or after the date, expand the Advanced tab, and enter your custom text.

In our example, I’ve added the ‘Today’s date’ text to the left of the widget, but you can add your custom text instead.
Once finished, please save your changes and visit the page to ensure it meets your requirements.
This article covered when and how to add today’s date to your WordPress website.
We explored a few different methods, one by using a plugin and others by using a theme, function, or page builder.
Leave us a comment and tell us which of the methods above you used to achieve this task.
The post How to Display Today’s Date in WordPress with or Without a Plugin appeared first on PluginsForWP.
]]>The post How to Display Category Description in WordPress appeared first on PluginsForWP.
]]>In addition, you can add relative keywords that will help the category archive page rank higher in the search results.
In this article, you’ll learn how to add and display categories description in WordPress.
By default, every time you add a category or tag to any post in WordPress, an archive page is automatically created for that category.
Categories archive pages will filter and display the posts under that specific category.
Adding a description to the categories pages will help search engines and visitors to understand that page better and, as a result, will help with SEO.

Because it’s a straightforward process to add and display the description, it makes it a no-brainer decision that you should do it.
We first need to enter the category editor page to add a category description.
Navigate into Posts -> Categories and click edit below the category you would like to edit.

Then, enter your text inside the description field and click update inside the edit category page.

Once saved, the category will now have a description. Verify if the page is displaying the description by visiting the archive page.
If you can see the description, you’re in luck. If you can’t see it, keep reading.
The description itself isn’t worth much if you don’t show it, not for user experience nor SEO.
Therefore, to get the most out of your categories pages, we should display our visitors’ descriptions.
You can show the description in a few different ways, based on your theme.
get_the_archive_title hookWordPress hooks enable you to modify the content of your website without messing with template files.
Many default hooks come with WordPress, and there are also theme-specific ones.
Because we can’t show you every possible theme, we will give you an example with a commonly used hook that should work with most themes.
The get_the_archive_title hook will allow us to get the archive title and add content.
WordPress is displaying the category description with the category_description() function.
We need to add the category_description() function to the get_the_archive_title hook and return the new result.
It may sound not very easy, but it isn’t.
Make sure to paste the code below into your child’s theme. If you don’t already have one, read our article on creating a child theme.
Tip: please backup your website before editing core files.
First, navigate to Appearance -> Theme Editor and click on the functions.php file from the right sidebar.
Scroll to the bottom of the file and paste this function:
add_filter( 'get_the_archive_title', 'p4wp_modify_archive_title', 10, 1 );
function p4wp_modify_archive_title( $title ) {
return $title . the_archive_description( '<h3>', '</h3>' );
}

Once saved, visit the category page and verify that the category description was added below the archive title.

This method will work with most themes. If it doesn’t work with yours, keep reading the following methods.
WordPress uses template files to display pages. It uses a different template to show various kinds of pages.
Because categories pages are archive pages, it will use the archive.php or category.php files to generate the page.
Therefore, we can enter the category description function into the desired position in the relevant template file to display the text.
Once again, navigate to Appearance -> Theme Editor and click on the archive.php file. If you can’t find that file, look for a different file that generates the category pages.
Then, paste the code below into the desired location. I’ll paste it just below the the_archive_title() function that generates the category name.
<?php echo category_description(); ?>

After saving the changes, open one of the categories pages and verify that the description was added successfully.
You can also display a description for a specific category by entering the category ID into the function.
For example, the code below will describe the category with an ID of 3.
<?php echo category_description(3); ?>
Replace the number in the function with the relevant ID number of the category description that you would like to display.
Make sure to read our article on finding pages and post IDs in WordPress.
There is no doubt that page builders are the easiest way to build websites with WordPress.
A page builder comes in handy even when creating archive pages. Elementor Pro, for example, allows us to take complete control of our website, including template files.
To create a category archive page with Elementor, navigate to Templates -> Add New and select the archive option.

Once the visual builder is loaded, drag the relevant elements, such as the title and posts, to the canvas on the right.
To display the category description, drag the text editor widget to the right just below the title or any other position.

The text editor widget came preloaded with default text. To replace it with the category description, click on the dynamic icon and select the archive description.

You can now style and design the element’s font, size, color, etc.
Finally, save the changes and set the condition to display the template for all archive pages or just categories pages.

Publish the template and visit one of the category pages to verify that the description is expected.

Additional page builder plugins to create category pages are Divi and Oxygen.
In this article, you learned how to display category descriptions in three different ways.
Leave us a comment and tell us which methods you used to achieve this task.
To further optimize your taxonomies pages, learn how to remove the category text from the URL.
The post How to Display Category Description in WordPress appeared first on PluginsForWP.
]]>The post How To Add A Title Tag In WordPress appeared first on PluginsForWP.
]]>By default, the title tag is generated automatically by WordPress to match the H1 page’s heading.
In this article, you’ll learn to add a title tag in WordPress.
Every HTML document, such as websites’ pages, should contain a title tag to rank better in Google.
The <title> tag text tells search engine bots what the page or the article is all about. Thus, it’s essential to have one.
WordPress automatically takes the page title (H1) and makes it the title tag to simplify things.
Navigate to your website, right-click anywhere on the screen, then click on ‘View Page Source.’

The title tag will be inside the <head> tag. Use CNTR+F or Command+F and search for <title>.

As you can see in the image above, the title tag text is our page title plus our website’s name.
<title>How to Add a Title Tag – Pluginizer</title>
In most cases, this is great and can be left alone. However, in other cases, you may want to modify the text to improve SEO, and in the next section, I will show you exactly how.
We already checked and saw that our page includes a title tag. To edit it, we will need to follow these steps:
First, let’s start by downloading an SEO plugin for WordPress.
There are many good SEO plugins for WordPress, and in this article, I’ll show you how to use the top three: Yoast, All-in-one, and RankMath.
Most likely, you already have one of the plugins above installed on your website.
If not, feel free to install any of them. Here at PluignsForWP, we’re using Yoast, but they are all great. To prevent conflicts between the plugins, make sure to install only one of the plugins above and not all of them.
First, navigate to Plugins -> Add New and search for SEO.
The first three results are the plugins that we will cover in this tutorial.
Install and activate your desired one.

Once activated the chosen plugin, we can move forward.
With whichever plugin you decide to use, we will need to open the page’s edit screen with the title tag that you would like to change.
Navigate to Pages -> All Pages and click on Edit of the page that you would like to modify.

After opening the edit screen, let’s move to the last step and add the title tag.
In this step, we will edit the title tag of the page. Follow the instructions related to the plugin you chose.
Scroll down the page to the Yoast SEO box and look for the SEO title field.
We can see in the image below that our title is automatically assembled by a few variables: title page, separator, and site name.

To modify that, delete all or some of the variables and enter your custom text instead.

When done, click on update and move on to the next step.
Scroll down to the AIOSEO box and into the Page Title field.
Just like above, this title is also generated automatically by variables.

To change it, delete the variables, enter your text, and click update afterward.

Click on the score button from the top right corner to open the Rank Math sidebar.

Click on the ‘Edit Snippet’ button below the General tab to edit the title tag.

Inside the popup, you’ll see that the title tag here is also generated by variables, just like the other plugins.

Replace the existing text with your custom one and close the popup when done.

Then, update the page and move on to verify.
Once we change the title tag, let’s ensure that the new text is displayed by inspecting the page source again, as we did above.
When looking for the new title tag, we can see that it’s showing the custom text that we chose.

Feel free to keep improving your page and add a meta description.
This article taught you how to add a title tag to your website by using the most popular SEO plugins.
Leave us a comment and let us know which one of the methods above you used to accomplish that.
The post How To Add A Title Tag In WordPress appeared first on PluginsForWP.
]]>