Do you want to display random posts in WordPress? Displaying random posts gives your users a chance to discover more of your content. In this article, we will show you how to easily display random posts in WordPress.
Why and Where to Display Random Posts in WordPress
By default WordPress lists your blog posts in reverse chronological order (from newest to oldest). This allows users to see your latest posts first.
However, most users will not get to see your older articles. If you have been running your site for quite some time now, then your older articles will not be prominently displayed anywhere.
One way to overcome this is by making internal linking a habit. Linking to your older articles in new posts will help users discover them. It will also increase your pageviews and improve your SEO score.
Another way around that is by displaying random posts in your sidebar. This way your users will get to discover posts that they would not see otherwise.
Having said that, let’s see how you can easily display random posts in WordPress.
Video Tutorial
Subscribe to WPBeginner
If you don’t want to watch the video tutorial, then you can continue reading the text version below:
Method 1: Display Random Posts in WordPress with a Plugin
This method is easier and is recommended for most users.
First thing you need to do is install and activate the Advanced Random Posts Widget plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit Appearance » Widgets page. You will notice a new widget labeled ‘Random Posts’ under the list of available widget.
You need to add this widget to a sidebar. See our guide on how to add and use widgets in WordPress.
Now, you will be able to see the widget settings. The default options will work for most websites, you can just click on the save button.
Advanced Random Posts Widget is a powerful plugin with tons of customization options. You can select different post types, show excerpt, show thumbnail, and skip posts you don’t want to show, or displays posts from specific categories or tags.
For more experienced users, the plugin also allows you to add custom before and after HTML, and your own custom CSS as well.
Don’t forget to click on the save button to store your widget settings. You can now visit your website to see random posts widget in action.
Method 2: Display Random Posts in WordPress Using Code
This method requires you to add code to your WordPress theme files. See our guide on how to copy paste code in WordPress.
First thing you need to do is add this code in your theme’s functions.php file or a site-specific plugin.
function wpb_rand_posts() {
$args = array(
'post_type' => 'post',
'orderby' => 'rand',
'posts_per_page' => 5,
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
$string .= '
';
while ( $the_query->have_posts() ) {
$the_query->the_post();
$string .= '
'. get_the_title() .'
';
}
$string .= '
';
/* Restore original Post Data */
wp_reset_postdata();
} else {
$string .= 'no posts found';
}
return $string;
}
add_shortcode('wpb-random-posts','wpb_rand_posts');
add_filter('widget_text', 'do_shortcode');
This code simply creates a function that displays 5 random posts. It then creates a shortcode so that you can easily display random posts anywhere on your site. Lastly, it enables shortcodes to be executed inside WordPress widgets so that you can use shortcode inside a text widget.
Now you can display random posts inside a WordPress post, page, or text widget using the shortcode [wpb-random-posts].
That’s all, we hope this article helped you learn how to display random posts in WordPress. You may also want to see these 12 WordPress sidebar tricks to increase pageviews.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Do you want to add a privacy policy on your WordPress site? Privacy policy is a document required by law that discloses the information you collect about visitors on your website. In this article, we will show you how to easily add a privacy policy in WordPress.
What is Privacy Policy and Do You Need it on Your Website?
All websites collect information about their visitors in different ways. In many countries (including the United States), websites are required by law to disclose the information they collect about their visitors and how this information is used.
Here are some of the ways in which a typical WordPress site collects user information.
All websites on the internet should have a privacy policy page. It protects your business from legal issues and also helps build consumer trust.
What to Include in a Privacy Policy?
The basic requirements for a privacy policy are quite simple. You need to list all the ways you collect or intend to collect user information on your website.
A simple privacy policy page should contain the following information:
Information you collect about users visiting your website.
Methods used to collect information, e.g. cookies and web beacons, sign up, registration, comment forms, etc.
Mention all third-party advertisers collecting user information on your website like Google Adsense.
Include links to the privacy policy of each advertising program you participate in
How users can block cookies and opt-out of third party advertisements
Your contact information so that users can reach out if they have questions
There are many websites on the internet that allow you to automatically generate text for your privacy policy or terms of service pages.
You can also use WPBeginner’s privacy policy page as an starting point. Simply replace all references to WPBeginner and our parent company with the name of your website or business.
Adding a Privacy Policy Page in WordPress
First you need to visit Pages » Add New in your WordPress admin area to create your new privacy policy page.
You should name your page Privacy Policy, so that your users immediately know what this page is about.
Next, you need to add the text for your privacy policy page. You can copy the text of our privacy policy page or use an online privacy policy generator.
You can even use a plugin like Auto Terms of Service and Privacy Policy to generate the content.
Don’t forget to add your own contact information and business name before hitting the publish button.
Adding Link to Privacy Policy Page in WordPress
Most websites display link to their privacy policy page in the footer area of their website. This way the link appears on every page but is not taking space in your main navigation menu.
There are multiple ways to do this. You can simply add the link to your theme’s footer.php file. If this is your first time editing a WordPress theme file, then take a look at our guide on how to copy paste code in WordPress.
Privacy Policy
Many WordPress themes have widget areas in the footer. You can add a custom menu widget with the link to your privacy policy page in this area.
First, you will need to visit Appearance » Menus page and create a new custom menu. See our beginner’s guide on how to add navigation menu in WordPress for detailed instructions.
Don’t forget to click on the save menu button to save your new menu.
After creating your menu head over to Appearance » Widgets page. You will notice ‘Navigation Menu’ widget under the list of available widgets.
Add this widget to your footer widget area. See our guide on how to add and use widgets in WordPress.
You will need to select the custom menu you created earlier in the widget settings and then click on the save button.
That’s all, you have successfully added a privacy policy page to your WordPress site.
We hope this article helped you learn how to add a privacy policy in WordPress. You may also want to see our step by step WordPress SEO guide for beginners.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Are you looking for WordPress restaurant themes? Restaurant websites have specific requirements to showcase their menu, photos, location, business hours, and other useful information. In this article, we have hand-picked some of the best WordPress themes for restaurants.
Building a Restaurant Website with WordPress
WordPress is the most flexible and easy to use platform to build your restaurant website. It gives you access to dozens of payment platforms, third-party addons, thousands of templates and plugins. See our article on why you should use WordPress for more details.
You will need a self-hosted WordPress.org site to take advantage of all the powerful features of a WordPress site. See our guide on the difference between WordPress.com vs self-hosted WordPress.org site.
To start your restaurant website, you will need a WordPress hosting account. This is where your website will live on the internet. You will also need a domain name, which will be your website’s address on the internet such as wpbeginner.com.
We recommend using Bluehost. They are one of the largest hosting companies in the world and also one of the official WordPress hosting partner.
Next you will need to install WordPress. If you want step by step instructions, you can follow our guide on how to start a WordPress blog.
After the installation, you can pick a theme from our expert selection below and then follow instructions in our how to install a WordPress theme article.
Now let’s take a look at some of the best WordPress restaurant themes. This list includes both free and paid WordPress themes. All themes in the list are mobile responsive.
1. Delicio
Delicio is a premium WordPress theme for restaurants. It comes with menu and location sections and supports WooCommerce out of box. It is compatible with restaurant reservation plugin allowing you to accept online reservations on your website.
The theme features large full screen header, bold call to action buttons, easy to use customization panel, and a live drag and drop page builder.
2. Rezo
Rezo is a bold yet elegant WordPress restaurant theme. It features a responsive slider, stylish restaurant menu, and Google Maps support.
It also comes with a lightbox gallery which allows you to beautifully display photos. Set up is easy by using the easy to use theme options panel.
3. Seasons
Seasons is an elegantly designed WordPress theme for restaurants, bars, cafes, and other food related websites. It comes with an easy to use restaurant menu page which is easy to setup using widgets as module.
Apart from that, it comes with all the features you would expect from a premium WordPress theme. Unique slider, easy theme options, quick setup, custom headers and styling.
4. Molino
Molino is a stylish WordPress theme for restaurants, coffee shops, and cafes. It features a very modern and hip look and comes with powerful features like page builder, layouts, content modules, events calendar, and much more.
It has Google Maps and contact form support built-in, which allows your users to easily find you. There are 5 color schemes ready to use and you can also choose your own color schemes.
5. Resto
Resto restaurant theme for WordPress comes with a powerful restaurant menu post type. Allowing you to easily add and update menu items. This beautiful premium theme comes with powerful features like drag and drop homepage builder, custom widgets, layouts, color choices, etc.
It comes with a very easy to use control panel allowing you to enable or disable features, upload logo, setup social networking, and much more.
6. Petit
Petit is a bright colored WordPress restaurant theme. It comes with beautiful layouts for recipe pages and custom shortcodes for a food related website.
It has a featured content slider, custom widgets, multiple color choices, and out of box support for multilingual websites.
7. Igloo
Igloo is a modern WordPress restaurant theme with large featured images, beautiful typography, and powerful features. It comes with a built-in restaurant menu management system, reservations, custom widgets, sliders, galleries, and testimonials.
It has an easy to use theme options panel and it supports many of the most popular WordPress page builders.
8. Chinese Restaurant
Chinese Restaurant is a WordPress theme for all kind of restaurants. It takes design inspiration from Chinese cuisine, hence the name.
It comes with a powerful drag and drop page builder. Allowing you to easily drop content modules to build your pages. The theme also has built-in menu management, appointments, restaurant menu management, galleries and much more.
9. Downtown
Downtown is a multi-purpose WordPress restaurant theme that can also be used for food blogging, restaurant reviews, bars, cafes, etc.
It comes with Google Maps, contact form, services, testimonials, staff profiles, and events calendar. You can use any colors to create your own color schemes, use custom backgrounds, and headers to make the theme truly yours.
10. Italica
Inspired by the Italian cuisine, Italica is a gorgeous WordPress theme for restaurants, cafes, and bars. It comes with 6 ready to use skins and comes with a powerful drag and drop builder. There are multiple layout choices and you can even create your own custom layouts.
It comes with appointment management system, restaurant menu builder, and many custom widgets. It is easy to setup and allows you to customize theme using live preview.
11. Restaurantz
Restaurantz is a free WordPress restaurant theme. It has a beautiful layout with large slider, call to action, and it utilizes theme customizer for all theme options.
It supports the powerful free page builder by SiteOrigin and restaurant menu support can be added using free third party plugins.
12. Bettaso
Beattaso is a premium WordPress cafe and restaurant theme. It comes with drag and drop page builder, appointment manager, and restaurant menu section.
It has multiple colors, layout, and skins which allow you to truly customize the theme. It also supports Google Fonts, Google Maps for locations, and has tons of premium theme features.
13. Bakes and Cakes
This beautifully designed WordPress theme is free and suitable for stylish restaurants and cafes. It comes with testimonial section, Product section, about section, team section, banner, and Call to action section etc.
It is compatible with popular free restaurant menu plugins, and it supports WooCommerce out of the box. The theme is also translation ready and can be used on multilingual websites as well.
14. Cafe Pro
Cafe Pro is built on top of the powerful Genesis theme framework by StudioPress. It comes with a rock solid foundation and great set of features for a premium WordPress restaurant theme.
Theme homepage layout can be easily customized using the four widgetized areas. You get an easy to use theme options panel and custom widgets that allow you to easily show contact info, address, business hours, etc.
15. Greek Restaurant
Greek Restaurant is a free WordPress restaurant theme. Built on top of Twitter’s bootstrap framework, this theme is fully responsive and looks good on all devices.
It comes with custom header, full width pages, shortcodes and a restaurant reservation system that allows you to accept reservations from your customers.
16. Mise En Place
Mise En Place is a stunningly beautiful WordPress theme for restaurants. It comes with a menu management system, page builder, and WooCommerce support.
Among other features, it supports large header images, custom widgets, shortcodes, Google Fonts integration, and live theme customizer.
17. Umami
Umami is a stylish restaurant theme for WordPress. It features a unique fullscreen layout with prominent call to action. Each post and page can have its own unique background.
The theme also comes with an easy to use restaurant menu management system. You can easily add menu items with images that open in a lightbox. It comes with custom widgets, shortcodes, Google Fonts, slideshow, and tons of other premium theme features.
18. Moonrise
Moonrise is a gorgeous WordPress restaurant theme. It features large header backgrounds, slideshows, shortcodes, and multiple customizable sections.
It comes with built in support for food menu, services, slideshow, contact widget, and contact blocks. It is easy to customize and translation ready out of the box.
19. Belise
Belise is a free WordPress restaurant theme. It is easy to setup recommends you to install recommended plugins upon activation. These plugins add features like events, restaurant menu, contact forms, etc.
It supports WooCommerce and page builder plugins out of the box. It is translation ready and can be used on multilingual sites as well.
We hope this article helped you find the best WordPress restaurant theme for your website. You may also want to see our list of 24 must have WordPress plugins for business websites.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Do you want to add a reviews page in WordPress? Many businesses add a customer reviews page on their website to showcase testimonials from their satisfied customers. In this article, we will show you how to easily add a customer reviews page in WordPress.
Why Add a Customer Reviews Page in WordPress
If you are running an online store or a business website, then you probably already have customers who are happy with your product and services.
Showing social proof like customer reviews and testimonials help you gain trust of new and potential customers.
A reviews page not only helps you win new customers, it also helps you build stronger relations with your existing customers. It shows that you care, and puts your customers under the spotlight.
At OptinMonster, we have a customer reviews page that highlight our customer success stories. It also allows us to talk to them and do full-blown case studies.
Now that you know the importance of customer reviews page, let’s take a look at how to easily create a reviews page on your WordPress site.
Add Customer Reviews Page in WordPress
First thing you need to do is install and activate the Easy Testimonials plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Easy Testimonials Settings page to configure plugin settings.
The plugin comes with a lot of different options. You can review the settings and adjust them to match your needs.
Don’t forget to click on the save changes button to store your changes.
Next, you need to visit Testimonials » Add New Testimonial page to add customer reviews.
Provide a title for the review and then enter the actual review in the post editor. You can create or select a category and add customer photo as featured image.
You will notice there is a testimonial information metabox below the post editor. This is where you will enter customer name, title, job description, email address, etc. You can also add the rating from 1-5.
Go ahead and publish the review. You can manually add as many customer testimonials as you like.
Display Customer Reviews on a WordPress Page
Easy Testimonials makes it super easy to add customer reviews to your website.
First you need to edit or create a new page in WordPress where you want to display customer reviews.
You will notice a new testimonials button on top of the post editor. Clicking on the button will display a number of options. You can display reviews in a list, grid, single review, testimonial slider, etc.
Selecting an option will bring up a popup where you can select different options. You can select a theme, width of reviews container, filter by category, show star rating, among other options.
Next, click on the ‘Insert Now’ button and the plugin will add a shortcode to the post editor.
You can now save and publish your page. After that visit your website to see your reviews page in action.
If you need help adding your reviews page to the navigation menu on your website, then check out our guide on how to add navigation menu in WordPress.
Collecting Customer Reviews on Your WordPress Site
Most businesses collect customer reviews by email. This way you can ask customers more personalized questions and ask for a photograph. It also allows you to avoid dealing with spam reviews.
However, if you would like to collect reviews directly on your website, then you will need to upgrade to the pro version of the plugin.
After that you can add this shortcode [submit_testimonial] inside a WordPress page to display a ‘Submit your review’ form.
Once users submit a review you will be able to see them as pending review under testimonials section in WordPress admin area. You can then review and edit the testimonial and publish it to appear on your reviews page.
Alternatively, you can use our WordPress form plugin, WPForms, that comes with a Post Submissions Addon. It allows you to collect user-submitted content including testimonials.
We hope this article helped you learn how to easily add a reviews page in WordPress. You may also want to see our list of 24 must have WordPress plugins for business websites
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Often beginner users ask us what are WordPress plugins and how do they work? Plugins are an important part of the WordPress ecosystem, and they are essential for building great websites using WordPress. In this beginners guide, we will explain what are WordPress plugins and how do they work?
What Are WordPress Plugins?
WordPress plugins are apps that allow you to add new features and functionality to your WordPress website. Exactly the same way as apps do for your smartphone.
There are more than 48,000 free plugins available right now on the WordPress.org plugin directory. Thousands more are available from third-party websites like Github.
On top of that, there are also thousands of premium WordPress plugins that are sold by individual developers and companies like ourselves.
In 2003, WordPress started as a simple tool to help you start a blog. Over the years, it has evolved into a powerful content management system and application framework, thanks primarily to plugins.
What Can WordPress Plugins Do?
WordPress plugins are small software apps that integrate and run on top of the WordPress software. This allows you to create almost any kind of website with WordPress (not just blogs).
For example, you can:
There is a popular saying in the WordPress community, “There is a plugin for that”.
No matter what you are trying to do on your WordPress site, it’s possible. If the feature is not available in default WordPress, then there is certainly a plugin available for that.
There are WordPress plugins to improve SEO, boost performance, add contact forms, social media buttons, create galleries, and so much more.
Plugins can be small and offer just one tiny little feature (like adding an image to sidebar).
Or they can also be quite large and act as their own platform as well (Example: WordPress eCommerce plugins or WordPress membership plugins).
More feature rich plugins can have their own addon plugins to extend them just like you would extend WordPress.
How WordPress Plugins Work?
WordPress is written in a way so that other developers can add their own code into it. The WordPress plugin API offers a robust set of hooks and filters which allow developers to modify existing WordPress functionality or add new functionality.
WordPress also allows developers to store data in the WordPress database. Plugins can utilize WordPress content types, taxonomies, and custom fields which allow users to store different types of content not just post and pages.
Each WordPress plugin installed on your site is registered in your WordPress database. You can activate and deactivate them at any time you want.
Upon each visit, WordPress connects to the database, loads the core software, and then loads your active plugins. All this code is processed on your server and then sent to user’s browser.
How to Find WordPress Plugins and Install Them?
You can find free WordPress plugins by visiting WordPress.org plugin directory or you can also find them directly from your WordPress admin area.
Simply head over to Plugins » Add New page and search by typing plugin name or functionality you want to add.
WordPress will search the plugin directory and display the available plugins in a list. You need to review the results, and click on the install now button next to the plugin you want to install.
However, search results inside the WordPress admin area are not always helpful because they are limited to free plugins only. Most beginners find it difficult to decide which plugin is best for the job.
Another approach is to look for plugin recommendations and tutorials on sites like WPBeginner.com. We have a WordPress plugins section where you can find the best WordPress plugins that we have thoroughly tested and reviewed.
You can also find WordPress plugins in our editor’s pick of the best WordPress plugins for business websites or checkout the plugins we are using on our website in the WPBeginner’s Blueprint.
More FAQs About WordPress Plugins
I cannot see or install plugins on my WordPress blog?
Most probably you are using WordPress.com. You can only install WordPress plugins on self-hosted WordPress.org websites. See our guide on the difference between self hosted WordPress.org vs free WordPress.com blog.
How many WordPress plugins are too many?
A common misconception among users is that too many plugins can slow down their website. It is NEVER too many plugins that are slowing down your site. It is always poorly coded plugins that degrade performance. For details see our guide on How many WordPress plugins should you install?.
Should I install plugins not tested with my WordPress version?
Sometimes authors of free plugins do not update their plugin files on each new WordPress release. Simply because if it works, then they don’t feel the need to update it. For more on this topic, see our article on installing plugins not tested with your WordPress version.
How to choose between free vs paid plugins?
There are thousands of free plugins and there is a good chance that you can find a free plugin offering the same functionality as a paid plugin. If it works good for you, then use it.
Please keep in mind that free plugins are offered as they are, with no warranties, and no promise of support. Plugin author can stop working on a plugin at anytime they want.
If you feel you will be needing lots of support, and you want regular updates, then paid plugins do a much better job at it.
We use a combination of both free and paid plugins on all our websites.
How do I get support for free WordPress plugins?
Free WordPress plugins are offered without the promise of support. However, most good plugins offer limited free support for their plugins through the official WordPress support forums. Simply visit the plugin page and click on the support tab to post your question.
For more on this topic, we recommend you take a look at our guide on how to properly ask for WordPress support and get it.
We hope this article helped you understand what are WordPress plugins and how do they work. You may also want to see our beginner’s guide on how to choose the best WordPress plugin.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.