Categories
Website

How to Display Random Posts in WordPress

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.

How to 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.

Random posts widget settings

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.

Random posts with thumbnail and excerpt

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].

Plain random posts list

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.



Source link

Categories
Website

How to Add a Privacy Policy in WordPress

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.

How to add a privacy policy page 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.

Creating a new privacy policy page in WordPress

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.

Creating a new custom menu

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.

Menu widget

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.

Privacy policy link in the footer

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.



Source link

Categories
Website

How to Easily Add a Customer Reviews Page in WordPress

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.

Adding a 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.

WPBeginner testimonials

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.

Easy testimonials settings page

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.

Adding customer reviews or testimonials

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.

Reviewer information

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.

Testimonials button

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.

Customize how you want to display reviews

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.

preview of a reviews page in WordPress

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.

Adding submit your review form in WordPress

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.



Source link

Categories
Website

What Are WordPress Plugins? And How Do They Work?

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? 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.

New plugins directory page on WordPress.org

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.

Installed WordPress plugins

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.

Searching for plugins from WordPress admin area

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.

Reviewing and installing plugin from search results

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.

Getting support for free WordPress plugins

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.



Source link