When my client asked about a new page on their WordPress website, a page that would display random content in two sections of the page, I had a number of questions about what they envisioned.
- What were the goals for the two sections?
- Was the content already available?
- Was the content images? Graphs? Videos? Text?
- Would the content be a mix of text and imagery?
- Would each piece of content link to another post or page on the client’s site? Or to an external site?
- What was the expected behavior for the two sections of content?
My client’s site is an academic site, showcasing research and case studies.
We already had a research page, highlighting recent research and case studies, which directed readers to blog posts to delve deeper.
What I Learned from My Client
For this particular page, the client wanted to highlight student projects, courses, and other news that wasn’t research by professors.
Each time someone visited the page, they would view a random piece of content in the sections.
The content could be anything: video, imagery, graphs, text from external sites.
What had me concerned: my client didn’t have the content available for my review. The content was an unknown, a black box.
I needed to find a flexible solution, one that would allow random content in two sections on a page.
Without knowing what that content might be.
Read on to learn about the elegant solution I implemented, one that was flexible and easy-to-manage.
Random Content Plugin
It took some research and a few conversations with my fellow web colleagues to learn what was possible.
For my client’s needs, I found the solution with the Random Content plugin.
- Display random content anywhere on your site using a shortcode or widget
- Organize your random content in groups, which allows you to display content in multiple locations (or on the same page) on your site
- Ability to add images, text, video, links, etc. to your random content
- Choose the number of posts you want to display
The plugin is free and has a five-star rating in the WordPress plugin repository.
Why I Like It
I needed a solution for randomly displaying specific content in two sections of the same page.
And I needed the flexibility to add any kind of content, without knowing what that content might be.
The Random Content plugin does exactly what I need. And it allows me to quickly edit the random content I’ve already created.
I found it easy to use.
How the Plugin Works
Once you’ve installed the Random Content plugin, you’ll find a new Random Content menu item in the Dashboard.
Select Random Content > Add and you’ll be presented with a familiar Classic Editor interface for entering title and content.
You can add a category for your random content in Group.
To use the shortcode on your site, add
[random-content] on a page or post. To add content from a specific group, add
If you want to specify how many random content items are displayed on a page or post, add
[random_content group_id="61" num_posts="3"].
To use the widget:
- Go to Appearance > Widgets
- Add the Random Content widget to a sidebar
- Select a group from the dropdown menu
- If there are no groups, or you don’t create a group, the widget uses all random content entries
Does It Work With the Block Editor?
When I added the Random Content plugin to my client site, they were using the Classic Editor.
Now, I’m converting the client site from Classic Editor to the Block Editor.
Which was going smoothly, until I saw there was no option to convert the content items to the Block Editor.
I visited the plugin support forum , and discovered the warning message that the plugin hasn’t been tested with the latest three major versions of WordPress.
That’s not good.
I was able to use the Shortcode block in the Block Editor to add the Random Content on pages, which I was glad about.
The only change I had to make was to enclose each content item in paragraph elements.
Prior to converting to the Block Editor, WordPress automatically wrapped the content item in a paragraph.
As for me and my client’s site, I asked the developer if there are plans to support the Block Editor.
Or if I missed an option for converting existing content items to the Block Editor.
Update: Good news! I heard back from the developer, Jeremy Green, who said he plans to convert the plugin to work with the Block Editor. Yay!
No timeline yet for the update.
Random Content was the only plugin I found that provided the options I needed: content that could be any format, that didn’t need to be hosted on the site, and could be added to posts or pages.
Quick to set up and straightforward for my client’s staff to use, Random Content has proven to be a good choice for my client.
If you’re using the Block Editor, the Random Content plugin will continue to work for you, using the shortcode block.
You’ll need to keep the Classic Editor plugin installed until the developer converts the plugin over to use the Block Editor.
Have you used the Random Content plugin? If yes, share your experience and tell me what you like best about the plugin in the comments.
Originally published January 20, 2020