WordPress Dynamic Content: What It Is and How to Create It

WordPress Dynamic Content: What It Is and How to Create It

What is WordPress dynamic content?

Most website content is static. That means that you enter the content directly in the content editor and all of your site’s visitors see the exact same content from the editor.

With WordPress dynamic content, on the other hand, you can dynamically populate certain content by pulling it in from your database. Here are some examples of WordPress dynamic content in action:

  • If you allow registration on your site, you could dynamically insert a user’s name to address them by their name. For example, user “Dave” would see the text “Hello, Dave,” while user “Sally” would see the text “Hello, Sally.” Or, you could dynamically insert each user’s profile image.
  • You can dynamically insert post information. For example, you could include the publish date of a post in your content. If you ever change the publish date in WordPress, that reference would dynamically update in the content.
  • You can dynamically insert a link, such as your affiliate link for a store. If you ever need to change that link, you could update the link in one spot and automatically start using the new affiliate link across your entire site.
  • You can dynamically insert information from custom fields. For example, you could use Advanced Custom Fields to store custom information and then dynamically pull in that information to display it in your post. If you ever update the data in the custom field, the information in the post will also update.
  • You can dynamically insert other information, such as today’s date. Every day, that reference will dynamically update to show the current date without requiring any manual effort.

Overall, understanding how to use WordPress dynamic content can open up a lot of opportunities for personalizing your website’s content, building custom content sites, streamlining your admin processes/removing manual labor, and more. 🤩

How to create WordPress dynamic content with Otter

Now that you understand what dynamic content is, it’s time to explore how you can create it. For this tutorial, we’ll be using Otter, a free plugin you can get from the WordPress plugin library.

Otter lets you easily start using WordPress dynamic content in the native WordPress block editor, without requiring any technical knowledge.

Once you’ve installed the plugin, you can start adding various types of dynamic content.

Below, you’ll learn how to work with a variety of different types of dynamic content in WordPress, including the following:

  1. Links
  2. Content values
  3. Data from the Advanced Custom Fields plugin (ACF)

Adding dynamic links to your WordPress site with Otter is quite simple.

First, you’ll need to highlight the text you want to add a link to, the same way you would if you wanted to add an ordinary link. Instead of clicking on the link icon, however, you’ll want to click on the down arrow and choose Dynamic Link from the dropdown menu:

Next, choose the type of link you’re adding from the Data Type dropdown menu. Your options include Post URL, Site URL, Featured Image URL, Author URL, and Author Website. If you decide to spring for the paid version of Otter, you’ll also have access to options for Post Custom Field and Advanced Custom Fields. For the purposes of this tutorial, we’ll choose Author URL.

WordPress dynamic content: dynamic link data set menu with "Author URL" highlighted.

You can also set the link to open in a new tab, then click Apply. From there, Update your page. Now you’ll be able to see your dynamic link when you look at the published version of the page, and when you click on it, you’ll be taken to the page for the author of the content:

WordPress dynamic content: example of author page.

2. Dynamic values 🎿

Next, let’s take a look at dynamic values. This feature allows you to easily add several types of content that will change to reflect the settings and content of the page you’re working on. In this section, I’ll show you how to add the most popular types of dynamic content.

Post information

First, if you want to add information about the post itself, type % into the area where you want to add it. A menu will appear with options for dynamic WordPress content you can insert:

WordPress dynamic content: Post with a header with the "%" symbol and a menu open. A red arrow points at the "Post Type" option at the bottom of the menu.

For this example, I chose Post Type. This selection now shows up in the editor:

WordPress dynamic content: blog post example with "Post Type" header in orange at the top.

Now you’ll be able to see the post type displayed in the preview or published draft of your page:

Preview of test page with "page" header based on "post type" dynamic content.

This can be an effective way to add post information to your content, but you’ll note that some forms of dynamic content offered by Otter don’t appear in the dropdown menu when you type %. If you want to add an author byline, for example, you’ll need to use a method similar to how we added the dynamic link in the previous section.

Click on the block or section of the block you want to add dynamic content to, then choose Dynamic Value from the menu that appears:

Additional block menu options menu with an arrow pointing to "Dynamic Value".

Next, select Author Name from the Data Type menu:

WordPress dynamic content: Dynamic Value Data Type menu with "Author Name" highlighted

Click Apply and then Update your page. Now when you open the page, you’ll be able to see the author name in the area you specified:

Dynamic WordPress content: example of a page with post type and author name information visible.

Dynamic images 🖼️

You can also add dynamic images to your WordPress pages. To start this process, create an image block and choose Media Library as the location for your image:

Image block with an arrow pointing to "Media Library".

Next, click on the Dynamic Images section of the Media Library. Here you’ll be able to choose from a variety of dynamic image types including Featured Image, User Image, and Website Logo. For this tutorial, I decided to use Author Image.

Dynamic image options menu.

Once you’ve picked the image type you want, click Select. This will place the appropriate image for this piece of content in your image block:

Author image example.

User information 🧑‍💻

Another type of dynamic value you can add is user information. This category of content is only displayed when a user is logged in and includes information like their username and email address. For example, if you want to create a membership program, you might want to use this feature to add a greeting to the page users see when they first log in.

To do this, write out your greeting, click on the down arrow in the block editor menu, and select Dynamic Value. Then, in the Data Type menu, scroll down to the Logged-in User options and choose Logged-in User Name.

Dynamic Value options with the Data Type menu open and "Logged-in User Name" highlighted.

Next, view the preview or published version of your page. You should now see your own name in this area:

Dynamic user info example of a greeting displaying a user's name.

3. Using Advanced Custom Fields to create WordPress dynamic content ⚙️

The next thing we’ll look at is how to use Advanced Custom Fields to create more types of dynamic content with Otter. To do this, you’ll need to install the Advanced Custom Fields plugin on your site. You’ll also need to invest in the Pro version of Otter.

Once you’ve installed Advanced Custom Fields, click on the ACF option now visible in the sidebar of your WordPress admin area:

Keep reading the article at CodeinWP. The article was originally written by Dianna Gunn on 2023-06-28 07:00:00.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Your ❤️ Love! Like Us
Scroll to Top