Meta Tag Archives - PluginsForWP https://plugins-for-wp.world/blog/tag/meta-tag/ Premium WordPress Plugins And Themes For An Affordable Price Wed, 12 Oct 2022 00:43:47 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://plugins-for-wp.world/wp-content/uploads/2020/01/cropped-Pluginsforwp-Favicon-32x32.jpg Meta Tag Archives - PluginsForWP https://plugins-for-wp.world/blog/tag/meta-tag/ 32 32 How to Display Today’s Date in WordPress with or Without a Plugin https://plugins-for-wp.world/blog/display-todays-date-in-wordpress/ https://plugins-for-wp.world/blog/display-todays-date-in-wordpress/#respond Mon, 19 Sep 2022 17:57:48 +0000 https://plugins-for-wp.world/?p=428876 Do you want to show today’s date on your WordPress website? 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. Why Displaying Today’s […]

The post How to Display Today’s Date in WordPress with or Without a Plugin appeared first on PluginsForWP.

]]>
Do you want to show today’s date on your WordPress website?

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.

Why Displaying Today’s Date

There are many reasons to display today’s date, and here are the main ones:

  • Your visitors will know that your website is being maintained daily. So you’re showing that it’s up-to-date with the latest trends.
  • Confirm that visitors view the latest updates and not an outdated cached version.
  • If you’re using a chat box plugin on specific hours to provide customer support, it’s vital to show the local time of your location. That will indicate to the customers what time they can reach you.
  • When using a countdown timer to run a time-sensitive campaign, show today’s date to create scarcity and increase conversion.
  • To show hours of operation of auctions and stock websites.
Show todays date on news websites

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.

Show Today’s Date in WordPress with a Plugin

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.

WP Date and Time WordPress 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.

WP Date and Time Plugin Shortcode

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

Date is displayed with a plugin shortcode

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.

Choose a date format in WordPress

Make sure to verify the new format once you save the changes.

Additional Shortcode Parameters

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.

Show Today’s Date without a Plugin

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.

Use a News Theme

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:

  • EasyMag
  • Jnews
  • Newsmag
  • AquaMag
  • News Pro
  • eNews
  • Amzola

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.

Uncheck the hide header date in theme

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.

Display Today’s Date with a Function

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')); ?>
PHP function to display todays date

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.

Custom shortcode display date

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.

Show Today’s Date with Elementor

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.

Elementor current date time dynamic tag

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.

Hide time Elementor

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

Add text before date

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.

Conclusion

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.

]]>
https://plugins-for-wp.world/blog/display-todays-date-in-wordpress/feed/ 0
How to Display Category Description in WordPress https://plugins-for-wp.world/blog/display-category-description-in-wordpress/ https://plugins-for-wp.world/blog/display-category-description-in-wordpress/#comments Wed, 05 Jan 2022 18:48:31 +0000 https://plugins-for-wp.world/?p=397961 Category description is necessary to describe the category and what the readers expect from that page. 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. Why Adding Category’s Description By […]

The post How to Display Category Description in WordPress appeared first on PluginsForWP.

]]>
Category description is necessary to describe the category and what the readers expect from that page.

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.

Why Adding Category’s Description

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.

Category description example

Because it’s a straightforward process to add and display the description, it makes it a no-brainer decision that you should do it.

How to Add a Category Description

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.

Edit category description

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

Enter category description

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.

Display Category Description in WordPress

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.

Method #1: use the get_the_archive_title hook

WordPress 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>' );
}
display category description with a hook

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

Display category description

This method will work with most themes. If it doesn’t work with yours, keep reading the following methods.

Method #2: insert in template files

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(); ?>
Display category description with a function

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.

Method #3: page builder plugins

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.

Create category description template with Elementor

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.

Dynamic test editor widget

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.

Dynamic category 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.

Set display condition Elementor template

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

Category description was added to archive template

Additional page builder plugins to create category pages are Divi and Oxygen.

Conclusion

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.

]]>
https://plugins-for-wp.world/blog/display-category-description-in-wordpress/feed/ 2
How To Add A Title Tag In WordPress https://plugins-for-wp.world/blog/how-to-add-title-tag-in-wordpress/ https://plugins-for-wp.world/blog/how-to-add-title-tag-in-wordpress/#respond Mon, 18 Jan 2021 18:50:57 +0000 https://plugins-for-wp.world/?p=218585 A title tag is one of the most important aspects of SEO for any page on your WordPress website. 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. What is a Title Tag Every HTML document, […]

The post How To Add A Title Tag In WordPress appeared first on PluginsForWP.

]]>
A title tag is one of the most important aspects of SEO for any page on your WordPress website.

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.

What is a Title Tag

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.

.

How to Find the Title Tag

Navigate to your website, right-click anywhere on the screen, then click on ‘View Page Source.’

View page source copy

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

Search for the title tag

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 &#8211; 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.

How to Add a Title Tag

We already checked and saw that our page includes a title tag. To edit it, we will need to follow these steps:

  1. Download an SEO plugin.
  2. Edit the desired page.
  3. Open the page source to verify the new title tag.

First, let’s start by downloading an SEO plugin for WordPress.

Step #1: Install an SEO plugin

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.

Most popular SEO plugins

Once activated the chosen plugin, we can move forward.

Step #2: Edit the desired page

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.

Edit a WordPress page

After opening the edit screen, let’s move to the last step and add the title tag.

Step #3: Edit the title tag

In this step, we will edit the title tag of the page. Follow the instructions related to the plugin you chose.

Yoast

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.

Add a title tag with Yoast

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

Edit title tag with Yoast

When done, click on update and move on to the next step.

All in one SEO

Scroll down to the AIOSEO box and into the Page Title field.

Just like above, this title is also generated automatically by variables.

AIOSEO page title

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

Modify the page title with AIOSEO

Rank Math

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

Rank Math on-page settings

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

Rank Math Edit Snippet

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

Default Rank Math title variables

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

Change title tag with Rank Math copy

Then, update the page and move on to verify.

Step #4: Verify the new title tag

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.

New title tag

Feel free to keep improving your page and add a meta description.

Conclusion

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.

]]>
https://plugins-for-wp.world/blog/how-to-add-title-tag-in-wordpress/feed/ 0