How to Create a WordPress Child Theme (Beginner’s Guide)

Do you want to create a child theme in WordPress?

A child theme is a WordPress theme that inherits the functionality of another WordPress theme. Many users create a child for their current theme so that they can safely customize their website design without losing changes when the theme developer releases an update.

In this article, we will show you how to create a child theme for your WordPress site.

How to Create a WordPress Child Theme

How Does a Child Theme Work, and Why Do You Need It?

A child theme inherits all the features, functions, and styles of another WordPress theme. When you create a child theme, the original theme is called the parent theme.

The inheritance includes the parent theme’s style.css file, which defines the theme’s main style. The child theme can override or extend its inherited properties by adding its own files or by modifying the existing ones.

While it is possible to customize your WordPress theme without installing a child theme, there are several reasons why you may need one anyway:

  • Child themes protect your customizations during theme updates, keeping them safe from being overwritten. If you modify the parent theme directly, then those tweaks might vanish when you update.
  • Child themes let you safely try out new designs or features without messing up the site’s original theme, similar to a staging environment.
  • If you know how to code, then child themes can make the development process more efficient. A child theme’s files are much simpler than a parent theme’s. You can focus on modifying only the parts of the parent theme that you want to change or expand on.

What to Do Before Creating a WordPress Child Theme

We’ve seen lots of WordPress users excited to dive into the technical stuff, only to get discouraged when errors pop up. We get it. That’s why it’s important to know what you are getting into before creating a child theme.

Here are some things we recommend you do first before continuing with this step-by-step guide:

  1. Be aware that you will be working with code. At the very least, you will need a basic understanding of HTML, CSS, PHP, and, optionally, JavaScript to understand what changes you need to make. You can read more about this in the WordPress theme handbook.
  2. Choose a parent theme that has your desired website design and features. If possible, find one where you only need to make a few changes.
  3. Use a local site or a staging site for theme development. You don’t want to create unintentional errors on your live site.
  4. Back up your website first.

There are several ways to create a child theme out of your existing theme. One is with manual code, while others require a plugin, which is a lot more beginner-friendly.

The first method may seem intimidating if you lack technical experience. That said, even if you choose one of the plugin methods, we still recommend reading through the manual method to familiarize yourself with the process and the files involved.

Pro Tip: Want to customize your theme without creating a child theme? Use WPCode to safely enable new features with custom code snippets without breaking your website.

With all that in mind, let’s get to how to create a child theme in WordPress. You can jump to the method you prefer using the links below:

Method 1: Creating a Child WordPress Theme Manually

First, you need to open /wp-content/themes/ in your WordPress installation folder.

You can do this by using your WordPress hosting’s file manager or an FTP client. We find the first option to be much easier, so we will use that.

If you are a Bluehost client, then you can log in to your hosting account dashboard and navigate to the ‘Websites’ tab. After that, click ‘Settings.’

Bluehost site settings

In the Overview tab, scroll down to the ‘Quick Links’ section.

Then, select ‘File Manager.’

Bluehost File Manager button

At this stage, you need to go to your website’s public_html folder and open the /wp-content/themes/ path.

Here, just click the ‘+ Folder’ button in the top left corner to create a new folder for your child theme.

Creating a new folder in Bluehost file manager

You can name the folder anything you want.

For this tutorial, we will just use the folder name twentytwentyone-child as we will use Twenty Twenty-One as our parent theme. Once done, just click ‘Create New Folder.’

Naming a new child theme file in Bluehost file manager

Next, you must open the folder you just made and click ‘+ File’ to create the first file for your child theme.

If you use an FTP client, then you can use a text editor like Notepad and upload the file later.

Creating a new file in Bluehost file manager

Go ahead and name this file ‘style.css’ ,as it is your child’s main stylesheet and will contain information about the child theme.

Then, click ‘Create New File.’

Creating a new stylesheet file in Bluehost file manager

Now, just right-click on the style.css file.

After that, click ‘Edit’ to open a new tab like in the screenshot below.

Editing a style.css file in Bluehost file manager

In this new tab, you can paste the following text and adjust it based on your needs:

/*
Theme Name:   Twenty Twenty-One Child
Theme URI:    https://wordpress.org/themes/twentytwentyone/
Description:  Twenty Twenty-One child theme
Author:       WordPress.org
Author URI:   https://wordpress.org/
Template:     twentytwentyone
Version:      1.0.0
Text Domain:  twentytwentyonechild
*/

Once done, just click ‘Save Changes.’

Saving a stylesheet file in Bluehost file manager

The next thing you need to do is create a second file and name it functions.php. This file will import or enqueue the stylesheets from the parent theme’s files.

Once you’ve created the document, add the following wp_enqueue code:

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    $parenthandle = 'twenty-twenty-one-style'; // This is 'twenty-twenty-one-style' for the Twenty Twenty-one theme.
    $theme = wp_get_theme();
    wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', 
        array(), // if the parent theme code has a dependency, copy it to here
        $theme->parent()->get('Version')
    );
    wp_enqueue_style( 'custom-style', get_stylesheet_uri(),
        array( $parenthandle ),
        $theme->get('Version') // this only works if you have Version in the style header
    );
}

Once done, just save the file like in the previous step.

Note: For this method, we recommend reading the official Child Themes and Including Assets documentation to make sure your child theme’s stylesheets are loaded properly.

You’ve now created a very basic child theme. When you go to Appearance » Themes in your WordPress admin panel, you should see the Twenty Twenty-One Child option.

Click the ‘Activate’ button to start using the child theme on your site.

Activating a child theme in WordPress admin

Method 2: Creating a Child Classic Theme With a Plugin

This next method uses the Child Theme Configurator plugin. This easy-to-use WordPress plugin lets you create and customize WordPress child themes quickly without using code, but it only works well with a classic (non-block) theme.

The first thing you need to do is install and activate the WordPress plugin. On activation, you need to navigate to Tools » Child Themes in your WordPress dashboard.

In the Parent/Child tab, you’ll be asked to choose an action. Just select ‘CREATE a new Child Theme’ to get started.

Creating a new child theme with Child Theme Configurator

Then, select a parent theme from a dropdown menu. We will select the Hestia theme.

After that, just click the ‘Analyze’ button to make sure the theme is suitable for use as a parent theme.

Choosing a parent theme in Child Theme Configurator

Next, you will be asked to name the folder the child theme will be saved in. You can use any folder name you want.

Below that, you need to select where to save the new styles: in the primary stylesheet or a separate one.

The primary stylesheet is the default stylesheet that comes with your child theme. When you save new custom styles to this file, you are directly modifying the main styles of your child theme. Every modification will overwrite the original theme’s style.

The separate option allows you to save a new custom style to a separate stylesheet file. This is useful if you want to preserve the original theme’s style and not overwrite it.

For demonstration purposes, we will choose the first option. But as you get more creative with your child theme customizations, you can always repeat this process and select the second option.

Choosing where to save the stylesheet in Child Theme Configurator

Moving down, you have to choose how the parent theme’s stylesheet will be accessed.

We will just go with the default ‘Use the WordPress style queue’ as it will let the plugin determine the appropriate actions automatically.

Choosing the parent theme stylesheet handling in Child Theme Configurator

When you get to step 7, you’ll need to click the button labeled ‘Click to Edit Child Theme Attributes’.

You can then fill in the details of your child theme.

Filling out the child theme details in Child Theme Configurator

When you create a child theme manually, you will lose the parent theme’s menus and widgets. Child Theme Configurator can copy them from the parent theme to the child theme. Check the box in step 8 if you’d like to do this.

Finally, click the ‘Create New Child Theme’ button to make your new child theme.

Clicking the Create New Child Theme button in Child Theme Configurator

The plugin will create a folder for your child theme and add the style.css and functions.php files you’ll use to customize the theme later.

Before you activate the theme, you should click the link near the top of the screen to preview it and make sure it looks good and doesn’t break your site.

Previewing a child theme in Child Theme Configurator

If everything seems to be working, click the ‘Activate & Publish’ button.

Now, your child theme will go live.

At this stage, the child theme will look and behave exactly like the parent theme.

Activating a child theme after it was made with Child Theme Configurator

Method 3: Creating a Child Block Theme With a Plugin

If you use a block theme, then WordPress offers an easy way to create a child theme with the Create Block Theme plugin.

First, you will need to install and activate the WordPress plugin. After that, go to Appearance » Create Block Theme.

Here, simply select ‘Create child of [theme name].’ We are using Twenty Twenty-Four in this example.

Once you’ve selected that option, fill out your theme’s information.

Creating a child theme with Create Block Theme

Below that, you can do more things like uploading a screenshot for the theme to differentiate it from other themes, adding image credits, linking to must-have WordPress plugins, adding theme tags, and so on.

Once you are done configuring the settings, just scroll all the way down and hit the ‘Generate’ button.

Generating a child theme with Create Block Theme

The plugin will now create and download a new child theme zip file to your computer.

If you open it, you will see three files: readme, style.css, and theme.json.

The theme.json file defines various aspects of a block theme, including its colors, typography, layout, and more. The plugin creates this file by default so that you can override or extend the parent theme’s style in the child theme later on.

At this stage, all you need to do next is go to Appearance » Themes.

After that, click ‘Add New Theme.’

Adding a new theme in WordPress

Next, select ‘Upload Theme.’

Then, choose the zip file and click ‘Install Now’ to install the WordPress theme.

Uploading a child theme in WordPress

Bonus Tip: Find Out If Your Theme Has a Child Theme Generator

If you are lucky, then your WordPress theme may already have an existing feature to create a child theme.

For example, if you use Astra, then you can go to the Astra Child Theme Generator website. After that, just fill out your child theme name and click the ‘Generate’ button.

Astra Child Theme Generator website

Your browser will then automatically download your child theme to your computer, which you can then install on WordPress yourself.

We also found some other popular WordPress themes that have a child theme generator:

How to Customize Your Classic Child Theme

Note: This section is for classic WordPress theme users. If you use a block theme, then just skip to the next section.

Technically, you can customize your child theme without code by using the Theme Customizer. The changes you make there won’t affect your parent theme. If you are not comfortable with coding yet, then feel free to use the Customizer.

That said, we also recommend customizing the child theme with code.

Besides learning more about WordPress theme development, code customization allows for the changes to be documented within the child theme’s files, making it easier to track them.

Now, the most basic way to customize a child theme is by adding custom CSS to the style.css file. To do that, you need to know what code you need to customize.

You can simplify the process by copying and modifying the existing code from the parent theme. You can find that code by using the Chrome or Firefox Inspect tool or by copying it directly from the parent theme’s CSS file.

Method 1: Copying Code from the Chrome or Firefox Inspector

The easiest way to discover the CSS code you need to modify is by using the inspector tools that come with Google Chrome and Firefox. These tools allow you to look at the HTML and CSS behind any element of a web page.

You can read more about the inspector tool in our guide on the basics of inspect element: customizing WordPress for DIY users.

When you right-click on your web page and use the inspect element, you will see the HTML and CSS for the page.

As you move your mouse over different HTML lines, the inspector will highlight them in the top window. It will also show you the CSS rules related to the highlighted element, like so:

Demonstrating how the Chrome inspect tool works

You can try editing the CSS right there to see how it would look. For example, let’s try changing the background color of the theme’s body to #fdf8ef. Find the line of code that says body { and inside it, the code that says color: .

Just click the color picker icon next to color: and paste the HEX code into the appropriate field, like so:

Now, you know how to change the background color using CSS. To make the changes permanent, you can open your style.css file in the child theme directory (using the file manager or FTP).

Then, paste the following code below the child theme information, like so:

/*
Theme Name:   Twenty Twenty-One Child
Theme URI:    https://wordpress.org/themes/twentytwentyone/
Description:  Twenty Twenty-One child theme
Author:       WordPress.org
Author URI:   https://wordpress.org/
Template:     twentytwentyone
Version:      1.0.0
Text Domain:  twentytwentyonechild
*/

body {
    background-color: #fdf8ef
}

Here is what it will look like if you go to the WordPress admin and open Appearance » Theme File Editor:

Adding custom CSS in a child theme's stylesheet in the theme file editor

If you are a beginner and want to make other changes, then we recommend getting familiar with HTML and CSS so that you know exactly what element each code is referring to. There are many HTML and CSS cheat sheets online that you can refer to.

Here is the complete stylesheet that we have created for the child theme. Feel free to experiment and modify it:

/*
Theme Name:   Twenty Twenty-One Child
Theme URI:    https://wordpress.org/themes/twentytwentyone/
Description:  Twenty Twenty-One child theme
Author:       WordPress.org
Author URI:   https://wordpress.org/
Template:     twentytwentyone
Version:      1.0.0
Text Domain:  twentytwentyonechild
*/

.site-title {
color: #7d7b77;
}
.site-description {
color: #aba8a2;
}
body {
background-color: #fdf8ef;
color: #7d7b77;
}
.entry-footer {
color: #aba8a2;
}
.entry-title {
color: #aba8a2;
font-weight: bold;
}
.widget-area {
color: #7d7b77;
}

Method 2: Copying Code From the Parent Theme’s style.css File

Maybe there are a lot of things in your child theme that you want to customize. In that case, it may be quicker to copy some code directly from the parent theme’s style.css file, paste it into your child theme’s CSS file, and then modify it.

The tricky part is that a theme’s stylesheet file can look really long and overwhelming to beginners. However, once you understand the basics, it’s actually not that hard.

Let’s use a real example from the Twenty Twenty-One parent theme’s stylesheet. You need to navigate to /wp-content/themes/twentytwentyone in your WordPress installation folder and then open the style.css file in your file manager, FTP, or Theme File Editor.

You will see the following lines of code:

:root {
/* Colors */
--global--color-black: #000;
--global--color-dark-gray: #28303d;
--global--color-gray: #39414d;
--global--color-light-gray: #f0f0f0;
--global--color-green: #d1e4dd;
--global--color-blue: #d1dfe4;
--global--color-purple: #d1d1e4;
--global--color-red: #e4d1d1;
--global--color-orange: #e4dad1;
--global--color-yellow: #eeeadd;
--global--color-white: #fff;
--global--color-white-50: rgba(255, 255, 255, 0.5);
--global--color-white-90: rgba(255, 255, 255, 0.9);
--global--color-primary: var(--global--color-dark-gray); /* Body text color, site title, footer text color. */
--global--color-secondary: var(--global--color-gray); /* Headings */
--global--color-primary-hover: var(--global--color-primary);
--global--color-background: var(--global--color-green); /* Mint, default body background */
--global--color-border: var(--global--color-primary); /* Used for borders (separators) */
}

Lines 3 to 15 control the type of colors (like yellow, green, purple) that the entire theme will use in their specific HEX codes. And then, for lines like ‘global-color-primary’ or ‘global-color-secondary,’ that means those are the primary and secondary colors of that theme.

You can copy these lines of code to your child theme’s stylesheet and then change the HEX codes to create your perfect color scheme.

As you scroll down in the parent theme’s stylesheet, you will notice that other variables may have these color variables, too, like here:

/* Buttons */
--button--color-text: var(--global--color-background);

This basically means all button texts will use the same color as declared in --global--color-background:, which is mint green (--global--color-green: #d1e4dd). If you change the HEX in --global--color-green:, then the button text will look different, too.

Note: If you use the Twenty Twenty-One child theme and do not see any changes, then you may need to update the ‘Version’ part of the theme file information (for example, from 1.0 to 2.0) every time you update the style.css file.

You can also follow these tutorials to experiment with your child theme customizations:

How to Customize Your Block Child Theme

If you use a child block theme, then most of your customizations will be done to your theme.json file, not style.css.

However, during our testing, we found the process to be complicated. Unlike classic child themes, there’s a bigger knowledge gap you need to fill in (especially about JSON and how CSS is handled there) if you are new to WordPress theme development.

That said, we found a much easier alternative using the Create Block Theme plugin. This tool can record any changes made in the WordPress Full Site Editor in your child theme.json’s file. So, you won’t have to touch any code at all because the plugin will take care of it for you.

Let’s show you an example. First, open the WordPress Full Site Editor by going to Appearance » Editor.

Selecting the Full-Site Editor from the WordPress admin panel

You will see several menus to choose from.

Here, just select ‘Styles.’

Opening the Styles menu in Full Site Editor

On the next page, you will see several built-in style combinations to choose from.

For our purpose, you can simply skip all of that and just click the pencil icon.

Clicking the Edit Styles button in the Full Site Editor

Now, let’s try changing some parts of your child theme, like the fonts.

For this example, go ahead and click ‘Typography’ in the right sidebar.

Clicking the Typography menu in Full Site Editor

Next, you will see some options to change the theme’s global fonts for text, links, headings, captions, and buttons.

Let’s click ‘Headings‘ for the sake of demonstration.

Clicking Headings in the Full Site Editor

In the Font dropdown menu, change the original pick to any font that’s available.

Feel free to change the appearance, line height, letter spacing, and letter casing if needed.

Styling headings in the Full Site Editor

Once you are done, just click ‘Save.’ After that, you can click the Create Block Theme button (the wrench icon) next to ‘Save.’

Then, click ‘Save Changes.’ This will save all of your changes to the child theme.json file.

Saving a child block theme's changes using the Create Block Theme plugin

If you open your theme.json file, then you will see the changes reflected in the code.

Here’s what we saw after we updated our child theme:

A child block theme.json file after changes were made to it using the Create Block Theme plugin

As you can see, now the file includes code that indicates that heading tags will use the Inter font with semi-bold appearance, 1.2 line height, 1 pixel line spacing, and in lowercase.

So, whenever you edit your child block theme, make sure to click the wrench icon and save your changes so that they are well-documented.

How to Edit a Child Theme’s Template Files

Most WordPress themes have templates, which are theme files that control the design and layout of a specific area inside a theme. For example, the footer section is usually handled by the footer.php file, and the header is handled by the header.php file.

Each WordPress theme also has a different layout. For example, the Twenty Twenty-One theme has a header, content loop, footer widget area, and footer.

If you want to modify a template, then you have to find the file in the parent theme folder and copy it to the child theme folder. After that, you should open the file and make the modifications you want.

For example, if you use Bluehost and your parent theme is Twenty Twenty-One, then you can go to /wp-content/themes/twentytwentyone in your file manager. Then, right-click on a template file like footer.php and select ‘Copy.’

Copying footer.php in Bluehost file manager

After that, enter the file path of your child theme.

Once you are done, simply click ‘Copy Files.’

Entering the child theme's file path to copy and paste the footer.php into inside Bluehost file manager

You will then be redirected to the file path.

To edit the footer.php file, just right-click on it and select ‘Edit.’

Editing footer.php in Bluehost file manager

As an example, we will remove the ‘Proudly powered by WordPress’ link from the footer area and add a copyright notice there.

To do that, you should delete everything between the <div class= "powered-by"> tags:

<div class="powered-by">
				<?php
				printf(
					/* translators: %s: WordPress. */
					esc_html__( 'Proudly powered by %s.', 'twentytwentyone' ),
					'<a href="' . esc_url( __( 'https://wordpress.org/', 'twentytwentyone' ) ) . '">WordPress</a>'
				);
				?>
			</div><!-- .powered-by -->

Then you need to paste in the code you find below those tags in the example below:

<div class="powered-by">
<p>© Copyright <?php echo date("Y"); ?>. All rights reserved.</p>
</div><!-- .powered-by -->

Here’s what you should now have in the text editor:

Replacing the WordPress footer links in footer.php inside Bluehost file manager

Go ahead and save the file to make the changes official.

After that, visit your website to see the new copyright notice.

Adding a dynamic copyright notice in footer.php

How to Add New Functionality to Your Child Theme

The functions.php file in a theme uses PHP code to add features or change default features on a WordPress site. It acts like a plugin for your WordPress site that’s automatically activated with your current theme.

You’ll find many WordPress tutorials that ask you to copy and paste code snippets into functions.php. But if you add your modifications to the parent theme, then they will be overwritten whenever you install a new update to the theme.

That’s why we recommend using a child theme when adding custom code snippets. In this tutorial, we will add a new widget area to our theme.

We can do that by adding this code snippet to our child theme’s functions.php file. To make the process even safer, we recommend using the WPCode plugin so that you don’t edit the functions.php file directly, reducing the risk of errors.

You can read our guide on how to add custom code snippets for more information.

Here is the code you need to add your functions.php file:

// Register Sidebars
function custom_sidebars() {

$args = array(
'id'            => 'custom_sidebar',
'name'          => __( 'Custom Widget Area', 'text_domain' ),
'description'   => __( 'A custom widget area', 'text_domain' ),
'before_title'  => '<h3 class="widget-title">',
'after_title'   => '</h3>',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget'  => '</aside>',
);
register_sidebar( $args );

}
add_action( 'widgets_init', 'custom_sidebars' );

Once you save the file, you can visit the Appearance » Widgets page of your WordPress dashboard.

Here, you will see your new custom widget area that you can add widgets to.

Creating a custom widget area for a child theme

There are plenty of other features you can add to your theme using custom code snippets. Check out these extremely useful tricks for the WordPress functions.php file and useful WordPress code snippets for beginners.

How to Troubleshoot Your WordPress Child Theme

If you’ve never created a child theme before, then there’s a good chance you’ll make some mistakes, and that’s normal. This is why we recommend using a backup plugin and creating a local site or staging environment to prevent fatal errors.

All that being said, don’t give up too quickly. The WordPress community is very resourceful, so whatever problem you are having, a solution probably already exists.

For starters, you can check out our most common WordPress errors to find a solution.

The most common errors you’ll probably see are syntax errors caused by something you missed in the code. You’ll find help in solving these issues in our quick guide on how to find and fix the syntax error in WordPress.

Additionally, you can always start again if something goes very wrong. For example, if you accidentally deleted something that your parent theme required, then you can simply delete the file from your child theme and start over.

We hope this article helped you learn how to create a WordPress child theme. You may also want to check out our ultimate guide to boost WordPress speed and performance and our expert pick of the best drag-and-drop page builders to easily design your website.

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.

The post How to Create a WordPress Child Theme (Beginner’s Guide) first appeared on WPBeginner.

How to Test Your WordPress Theme Against Latest Standards

Do you want to see if your WordPress theme meets the latest standards?

The WordPress theme review team has set high standards for free WordPress themes submitted to the official directory. These standards ensure the theme is safe, user-friendly, and accessible to WordPress users.

In this article, we will show you how to test your WordPress theme against the latest standards.

How to Test Your WordPress Theme Against Latest Standards

Why Test Your WordPress Theme Against Latest Standards?

Whether you are a WordPress website owner or a theme developer, testing a new theme against the latest standards before using it is crucial for a few reasons:

  • Compatibility check Testing ensures the theme will work well with the current version of WordPress.org and any future updates, preventing compatibility issues.
  • Spotting errors and glitches – Testing helps find and fix any problems that could affect how your WordPress blog or site functions or looks. This is especially important if the theme is from a third party.
  • Better user experience – Testing ensures the theme follows modern web standards, like accessibility and mobile-friendliness. Not only will this make the site that uses the theme user-friendly, but it is also good for search engine optimization (SEO).
  • Better security – By testing against the latest standards, you can prevent security vulnerabilities and protect the site from common threats. This is particularly true if you are installing a theme for a WooCommerce site because you will be handling customers’ payment details.

With that in mind, let’s see how you can test your WordPress theme against the latest standards. You can use the quick links below to skip to a specific topic:

What Standards Does the WordPress Theme Review Team Check?

The WordPress theme review team checks many aspects of a theme when it is submitted. You can learn more about this in the official WordPress theme requirement doc.

But here are the most important things you should know about what they check:

  • Make sure the theme doesn’t collect user data by default. You can check the readme.txt file for details on data usage and a clear privacy policy.
  • In terms of WordPress accessibility, you must ensure the theme has skip links for easy navigation and that keyboard navigation is clear. Links in content and comments should be underlined for easy identification.
  • Check for PHP or JavaScript errors and ensure the theme follows secure coding standards.
  • Admin notices in the WordPress dashboard should be easy to dismiss and follow standard design.
  • Check if the theme recommends WordPress.org plugins. Plugins should not be installed automatically without user permission.
  • Ensure the theme complies with rules about credits and links. Avoid themes with intrusive upselling or spammy behavior.
  • Verify that the theme uses a GPL-compatible license, preferably GPLv2 or later.

These standards may not be significant for theme developers if you are working on a theme for a client or personal use.

However, if you want to release your WordPress theme for other people to use, then it is a great idea to check that it meets the minimum requirements above.

Now, let’s take a look at how to test a WordPress theme against the latest standards.

Step 1: Enable Debug Mode on Your WordPress Site

This first step is optional because the plugin you will use later will still work regardless if you follow this step or not.

That said, we recommend enabling debug mode on your WordPress website and testing your theme on a local WordPress site or a staging site.

Debug mode is a feature in WordPress that provides error reporting, making it easier to identify and fix issues. When the debug mode is enabled, WordPress will display any PHP errors, warnings, or notices about the WordPress theme.

However, debug mode is not recommended on a live site. That’s why we suggest creating a local version of your site or using a staging environment from your WordPress hosting.

You can read our article on how to enable debug mode in WordPress for step-by-step instructions.

We recommend using the WP Debugging method. This WordPress plugin will enable debug mode without you having to edit your website files, making it much easier.

View the wp debugging settings

Step 2: Install the Theme Check Plugin

The next step is to install the Theme Check plugin. Created by the WordPress theme review team themselves, this plugin is actually intended for theme developers.

If you are a website owner, then you can also use it to see if a theme meets the latest standards. You can test free themes from the official theme directory or premium WordPress themes to see if they follow WordPress guidelines.

If you need some pointers on setting up the plugin, then read our beginner’s guide to installing WordPress plugins.

Once the plugin is active, just go to Appearance » Theme Check. Then, select your current theme or a previous one from the dropdown menu and hit the ‘Check it!’ button.

Using the Theme Check plugin to check a theme's compatibility with the latest standards

Theme Check will start testing your theme against the latest WordPress theme development standards. Once it is done, it will show you the warnings it found during the tests.

Here is an example of a theme that passes the check:

An example of a theme that passes the Theme Check test

On the other hand, the screenshot below shows what a theme that does not pass the check looks like.

The plugin will tell you about errors it found and share them in detail below. This information is meant as feedback for theme developers so that they can fix the issues.

An example of a theme that doesn't pass the Theme Check test

If you are a website owner, then you can take a screenshot of this feedback and share it with the theme developer, or just find another theme alternative that meets the latest standards.

Need some inspiration for theme alternatives? Check out our expert pick of the best and most popular WordPress themes.

What Other Parts of a WordPress Theme Should You Test?

When testing WordPress themes, you should also focus on several key areas beyond the theme review standards:

  • Responsiveness Check how the theme behaves on various devices and screen sizes. It should be fully responsive and display well on both desktop and mobile devices.
  • Performance – Test the theme’s performance. A fast-loading theme can speed up your WordPress site and positively impact user experience. You can use tools like Google’s PageSpeed Insights or GTmetrix to analyze your site’s speed.
  • Plugin compatibility – Install any plugins that you plan to use on your website and test if their functionality works with your new theme.
  • Browser compatibilityTest the theme in different browsers like Safari, Chrome, Opera, Firefox, and Microsoft Edge.
  • Custom functionality – If you plan to add custom functionality through a plugin or a child theme, ensure it works correctly with the theme.

We hope this article helped you learn how to check your WordPress theme against the latest standards. You may also want to check out our article on how to create a custom WordPress theme without code or our ultimate guide to WordPress security.

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.

The post How to Test Your WordPress Theme Against Latest Standards first appeared on WPBeginner.

How to Highlight New Posts for Returning Visitors in WordPress

Are you wondering how to highlight new posts for returning visitors in WordPress?

Showing off the posts that were newly published on your website is one way to keep your readers updated and make sure they don’t miss out on your latest content.

In this step-by-step guide, we will show you how to highlight new posts for returning visitors in WordPress.

How to Highlight New Posts for Returning Visitors in WordPress

Why Highlight New Posts on Your WordPress Site?

Highlighting new posts on your WordPress site helps returning visitors easily discover your new content. This way, they won’t miss out on any fresh information or updates you’ve added to your blog.

Labeling new posts improves the user experience on your WordPress website. When a returning visitor reaches your website, they can easily spot which posts they haven’t read yet, saving them a lot of time and increasing your pageviews.

A good user experience on your site not only keeps visitors happy but also helps with SEO. When your site is easy to use, it improves your search engine rankings and increases the likelihood of visitors finding your content.

With that in mind, let’s see how you can highlight new posts for returning visitors in WordPress.

We will show you two methods: one with a WordPress plugin and the other with code. You can jump to a specific method using the quick links below:

Method 1: Highlight New WordPress Posts With a WordPress Plugin

This first method uses the Mark New Posts plugin. We recommend it for complete beginners because it’s very simple. This plugin will add a label to show which blog posts your site visitors haven’t seen yet.

Firstly, you need to install and activate the Mark New Posts plugin. If you need guidance, see our step-by-step guide on how to install a WordPress plugin.

After that, go to Settings » Mark New Posts from the WordPress admin area. You will now see the plugin’s settings page.

What you want to do now is select where to display the ‘New’ label. You can select After post title, Before post title, or Before and after post title.

We find that adding the label after the post title will look like a notification and grab users’ attention the most, so that’s what we’ve chosen.

Selecting the new post marker placement in Mark New Posts plugin

Next, you need to choose what the marker looks like in the Marker type setting. The options include “New” text, “New” text legacy, Orange circle, Flag, Picture, or None.

Be sure to explore each option to see which one looks best with your website design.

Selecting a new post marker type in Mark New Posts plugin

Another setting you can configure is the background color for the new post’s title. If you enable this, then when a reader visits a new post, they will see that the post title section has a background color. We didn’t find this setting necessary, so we disabled it.

In the ‘Consider a post as read’ setting, you can choose when to turn off the new post label: after it was opened, after it was displayed in the list, or after any web page of the blog was opened.

We suggest going with ‘after it was opened.’ This means that if a visitor hasn’t read several posts and opens one, then the new post label for the other articles won’t disappear.

Next, you can select how many days the post should stay highlighted as new, show all existing posts as new to new visitors, and disable the new label for custom post types.

The Mark New Posts plugin settings page

The last two settings are pretty advanced.

One is to ‘Allow outside the post list,’ which means you can highlight posts outside of the loop, like in widget-ready sidebar areas. Be cautious about enabling this setting, as it may create unwanted WordPress errors.

The other is ‘Use JavaScript for showing markers’, which is only recommended if the plugin is not compatible with the theme or other plugins being used on your blog. In most cases, you will want to keep this setting disabled.

Once you are done configuring the plugin settings, just click ‘Save.’

Clicking the Save button in Mark New Posts plugin

And that’s it! Go ahead and visit your website in incognito mode to see if the new labels for recent posts are live.

Here’s what it looks like on our demo website:

Example of the new post marker made by Mark New Posts plugin

Method 2: Highlight New Posts by Adding Custom Code

Are you unhappy with the new post label options given by the previous plugin? If so, then you can highlight new posts using custom code instead.

For beginners, this method may seem intimidating. But don’t worry because we will use the WPCode plugin to safely insert code snippets in WordPress without breaking your website.

WPCode also makes it easy to manage multiple custom code snippets, which will be handy in our case since we will be using more than one.

WPCode - Best WordPress Code Snippets Plugin

Note: While there is a free version of WPCode, we will use WPCode Pro because it allows you to insert the code snippets into the proper locations for this tutorial.

The first thing you need to do is install WPCode in WordPress. For setup instructions, go ahead and check out our article on how to install a WordPress plugin.

Next, go to Code Snippets » + Add Snippet from your WordPress dashboard. After that, select ‘Add Your Custom Code (New Snippet)’ and click the ‘Use snippet’ button.

Adding custom code in WPCode

Now, let’s add a title to your code snippet so that it’s easier to find it later on if needed. For this, you can name it something like ‘WordPress Last Visit Title Modifier.’

Then, select ‘PHP Snippet’ in the Code Type dropdown.

Giving the custom code snippet a title and selecting the PHP code type in WPCode

After that, you can copy and paste the code snippet below:

// Define a function to modify post titles based on the last visit
function wpb_lastvisit_the_title($title, $id) {

    // Check if not in the loop, a singular page, or a page post type; if true, return the original title
    if (!in_the_loop() || is_singular() || get_post_type($id) == 'page') return $title;

    // Check if no 'lastvisit' cookie is set or if it is empty; if true, set the cookie with the current timestamp
    if (!isset($_COOKIE['lastvisit']) || $_COOKIE['lastvisit'] == '') {
        $current = current_time('timestamp', 1);
        setcookie('lastvisit', $current, time() + 60 * 60 * 24 * 7, COOKIEPATH, COOKIE_DOMAIN);
    }

    // Retrieve the 'lastvisit' cookie value
    $lastvisit = $_COOKIE['lastvisit'];

    // Get the publish date of the post (in Unix timestamp format)
    $publish_date = get_post_time('U', true, $id);

    // If the post was published after the last visit, append a new span to the title
    if ($publish_date > $lastvisit) $title .= '<span class="new-article">New</span>';

    // Return the modified or original title
    return $title;
}

// Add a filter to apply the 'wpb_lastvisit_the_title' function to 'the_title' hook with priority 10 and 2 parameters
add_filter('the_title', 'wpb_lastvisit_the_title', 10, 2);

What this snippet does is modify WordPress post titles based on a user’s last visit.

It checks if the page is a blog post or not, and if not, then it will display the original title as is. But if it is a blog post, then the title will be modified.

Then, the snippet ensures the lastvisit cookie exists. If it doesn’t, then the code creates it and sets it to the current time. The function then compares this lastvisit time with the post’s publish date and adds a ‘New’ label to the title if the post is newer than the last visit.

Once you have inserted the code snippet, just scroll down and select ‘Auto Insert’ for the Insert Method.

Other than that, make sure to choose ‘Frontend only’ for the Location. This means the code will only run on the part of your WordPress blog that visitors interact with and not in your admin panel or other places.

Modifying the insertion settings in WPCode and activating and publishing the code

With that done, you can make the code ‘Active’ and click ‘Save Snippet.’

Now, repeat the step to add a new custom code snippet. This time, the code will style the ‘New’ label that is added to recent post titles based on the last visit of a user.

So, you can name it something like ‘Post Title New Label Style’ and the Code Type should be ‘CSS Snippet.’

Creating a CSS code to customize the new post label in WPCode

You can then copy and paste the following lines of code into the Code Preview box:

/* CSS to style the "New" label in blog post titles */
.new-article {
    background-color: #4CAF50; /* Green background color */
    color: #ffffff; /* White text color */
    padding: 2px 5px; /* Padding around the label */
    margin-left: 5px; /* Adjust the margin to your preference */
    border-radius: 3px; /* Rounded corners for the label */
    font-size: 12px; /* Adjust the font size to your preference */
}

This code snippet essentially customizes the ‘New’ post label using a custom background color, text color, padding, margin, border radius, and font size.

Feel free to adjust these elements to your preferences as you go along. Just make sure to use hex color codes or RGB values for the background and text colors.

In the Insertion section, select ‘Site Wide Header’ as the Location. After that, make the code ‘Active’ and click ‘Save Snippet.’

Choosing Site Wide Header as the code location in WPCode

And that’s it! To see if the code works, you can publish a new blog post and visit your website in incognito mode.

If the code is successful, then you should see a ‘New’ label next to your recent post titles.

Example of the new post label made with WPCode

Besides highlighting new posts for your returning visitors, there are many other ways to keep your readers engaged.

Ideally, you want visitors to check out not just one but three or more blog posts in one sitting. This shows that they are enjoying your content and are taking part in the community you are building.

However, sometimes, it can be hard for readers to find content that’s relevant to their interests. That’s where internal linking comes in.

Internal links are links that direct users to other pages or posts on your website.

You can use them directly within your blog posts. Or you can create a section under the post to show which blog posts are currently popular among your readers.

If you are not sure which internal links to use in a blog post, then All in One SEO (AIOSEO) has a link assistant feature that can give you some ideas.

View links details

For more information about internal linking, see our ultimate internal linking guide for SEO.

We hope this article has helped you learn how to highlight new posts for returning visitors in WordPress. You may also want to check out our WordPress SEO checklist for beginners and easy ways to increase your blog traffic.

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.

The post How to Highlight New Posts for Returning Visitors in WordPress first appeared on WPBeginner.

How to Create a Mobile-Ready Responsive WordPress Menu

Do you want to create a mobile-ready responsive WordPress menu?

More than half of all website traffic comes from mobile devices. If your navigation menu doesn’t work well on smartphone and tablets, then a big chunk of your audience may struggle to find their way around your site.

In this guide, we will show you how to create a mobile-ready responsive WordPress menu.

How to create a mobile-ready responsive WordPress menu

Why Create a Mobile-Ready Responsive WordPress Menu?

A well-designed navigation menu will help visitors find their way around your website. However, just because you menu looks great on desktop computers, doesn’t automatically mean it will look good on smartphones and tablets too.

Mobile users make up around 58% of all internet traffic. That said, if your menu doesn’t look good or work correctly on mobile devices, then you risk losing half your audience. This will make it difficult to achieve key goals such as growing your email list, getting sales, and growing your business.

With that being said, let’s see how you can create a mobile-ready responsive menu that will look great on smartphones and tablets. Simply use the quick links below to jump straight to the method you want to use.

Method 1: Create a Mobile-Ready Responsive Slide Panel Menu

A responsive slide panel is a navigation menu that slides onscreen when a visitor taps or clicks on a toggle.

A sliding side panel menu in WordPress

In this way, the menu is always within easy reach but doesn’t take up any onscreen space by default. This is particularly important since smartphones and tablets have much smaller screens compared to desktop computers.

If the menu is constantly expanded, then a mobile user may trigger its links by accident using their device’s touchscreen. This makes slide panels a good choice for a mobile-responsive menu.

The easiest way to add a mobile-ready slide panel is by using Responsive Menu.

Note: There is a premium version of Responsive Menu with extra themes and additional features such as conditional logic. However, in this guide, we’ll use the free plugin since it has everything you need to create a mobile-ready menu.

The first thing you need to do is install and activate the Responsive Menu plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you can use the plugin to customize any WordPress menu you’ve previously created. If you need to create a new menu, then please see our guide on how to add a navigation menu in WordPress.

If your WordPress theme already has a built-in mobile menu, then you’ll need to know that menu’s CSS class so you can hide it. If you skip this step, then mobile users will see two overlapping menus on your website. For step-by-step instructions, please see our guide on how to hide a mobile menu in WordPress.

With that done, go to the Responsive Menu » Menus page and click on the ‘Create New Menu’ button.

Creating a mobile-ready responsive menu

You will now see a few different themes that you can use for your menu.

We’re using the ‘Default Theme’ in our images but you can use any theme you want. After making your decision, click on ‘Next.’

Choosing a template for your navigation menu

You can now type in a name for the menu. This is just for your reference so you can use anything you want.

With that done, click on ‘Link WordPress Menu’ and choose the menu that you want to use.

Adding a responsive menu to a WordPress blog or website

As already mentioned, if your theme already has a built-in mobile menu, then you’ll need to add its CSS class to the ‘Hide Theme Menu’ field.

If you upgrade to the premium plugin, then you’ll get a few additional settings. For example, Pro users can hide the menu on particular pages or devices.

When you’re happy with how the menu is set up, click on ‘Create Menu.’

How to create a mobile-ready menu for your website or blog

You’ll now see a preview of your WordPress website on the right of the screen, and some settings on the left.

To see how your site looks on mobile, click on either the mobile or tablet icon towards the bottom left of the screen.

Previewing a responsive menu on a smartphone or tablet

To customize how the menu looks and acts on mobile devices, select ‘Mobile Menu.’

Then, click on ‘Container.’

Designing a mobile-responsive WordPress navigation menu

Here, you’ll find lots of different settings.

As you make changes, the live preview will often update automatically. With that in mind, it’s a good idea to expand the menu so you can monitor how your mobile menu will look. To do this, simply click on the menu toggle button.

How to preview a mobile menu on desktop

By default, the plugin adds a title and some ‘Add more content…’ text.

You can replace this with your own messaging, or even remove the text completely. To edit the title, click to expand the ‘Title’ section.

Adding a custom title to a navigation menu

You can now type your own messaging into the ‘Title Text’ field.

You can also add a link to the title, or add icon fonts and images.

Customizing the title in a WordPress navigation menu

To customize how the title looks, click on the ‘Styles’ tab.

Here, you can change the background color, the text color, the font size, and more.

Customizing how a menu looks using a free WordPress plugin

If you don’t want to show any title text, then click to deactivate the toggle next to ‘Title.’

If the title isn’t essential, then removing it will create more space for the links and other content in your mobile navigation menu.

Removing the title from a WordPress navigation menu

To replace the ‘Add more content here….’ text with your own messaging, click to expand the ‘Additional Content’ area.

You can now type in your own text, change the text color, change the text alignment, and more by using the settings in the left-hand menu.

Adding your own messaging to a mobile-ready navigation menu

To remove the text completely, simply click to deactivate the toggle.

Once again, this can create more room for the rest of the menu’s content. This is particularly useful on smartphones and tablets, which typically have smaller screens.

Creating a unique menu for a smartphone or tablet

By default, Responsive Menu will show all your menu items as a single list. However, you may prefer to show these links in multiple columns. This can work well if your menu labels are shorter, as it allows you to show more items in a smaller amount of space without the menu looking cluttered.

To try different column layouts, click to expand the ‘Menu’ section.

Expanding the WordPress navigation menu settings

You can now open the ‘Menu container columns’ dropdown and choose the number of columns you want to use.

At this point, you may see some ‘Update Required’ text. If you see this message, then give it a click to update the live preview with your new column settings.

Creating a multi-column menu layout

By default, Responsive Menu adds a search bar to your WordPress menu. This can help visitors find interesting content, but it can also take up precious onscreen space.

If you prefer, then you can remove the search bar for mobile users by deactivating the toggle next to ‘Search.’

Removing a search bar from the WordPress mobile menu

There are lots more settings that you can configure, so you may want to spend some time looking through the other options. However, this is enough to create a well-designed mobile-ready menu.

When you’re happy with how the navigation menu is set up, click on ‘Update.’

Making the mobile-responsive menu live on your website

Now, simply visit your WordPress blog using a mobile device, to see the new menu in action. You can also view the mobile version of your WordPress site from desktop.

Method 2. Create a Mobile-Ready Fullscreen Responsive Menu

Another option is to add a fullscreen responsive menu. This is a menu that automatically adjusts to different screen sizes, so the navigation menu will always look good no matter what device the visitor is using.

Since the menu takes up all the available space, it is easier to navigate on smartphones and tablets, no matter how small the screen.

The easiest way to create a fullscreen menu is by using FullScreen Menu – Mobile Friendly and Responsive. This plugin allows you to create a fullscreen menu for mobile devices only, or you can show the same menu across smartphones, tablets, and desktop computers, so all visitors have the same experience.

The first thing you need to do is install and activate the FullScreen Menu plugin. You can check our step-by-step guide on how to install a WordPress plugin for more details.

Upon activation, select Fullscreen Menu Options from the WordPress menu and check the following box: ‘Activate Animated Fullscreen Menu.’

Creating a fullscreen menu for smartphones and tablets

We also recommend checking the ‘Show the menu only for Admin users’ box. This allows you to see the changes as you’re configuring the menu, but visitors won’t see the mobile menu until you make it live.

By default, the plugin will show the fullscreen menu on all devices. If you want to show the fullscreen menu on smartphones and tablets only, then check the box next to ‘Mobile only.’

Showing a fullscreen menu on a mobile device

With that done, you’re ready to fine-tune how the menu looks by clicking on the ‘Design / Appearance’ tab.

Here, you can choose the colors, font, and animation settings for the fullscreen menu.

Adding custom colors to a mobile-responsive menu

When making these changes, just be aware that ‘Initial Background Menu’ is the menu’s toggle icon. Meanwhile, ‘Opened Background Menu’ is the color of the expanded, fullscreen mobile menu.

After choosing the menu colors, scroll to the ‘Menu Appearance’ section. Here you can change the menu’s font color, font family, and font size.

Changing the appearance of a mobile navigation menu

Just be aware that loading additional fonts could affect your WordPress site performance and speed. This isn’t always a good choice for mobile devices, which typically have less processing power compared to desktop computers. Some visitors may also have a poor mobile internet connection, which will make your site load even more slowly.

With that done, scroll to ‘Animation Settings.’.

To start, you can choose how the menu will expand when a visitor clicks the toggle icon. Simply open the ‘Animation Type’ dropdown menu and choose an option from the list, such as From Top to Bottom or From Left to Right.

Adding animation effects to a mobile website

When you’re happy with how the menu is set up, it’s time to add some content by clicking on the ‘Menu Content’ tab.

Here, go ahead and open the ‘Select Menu’ dropdown and choose the menu that you want to show fullscreen.

Creating a mobile-responsive WordPress menu

If you haven’t created a navigation menu yet, then check out our guide on how to add navigation menus in WordPress.

If you want to show additional content in the menu, then you can add it in the ‘Free HTML / Shortcodes’ box. This acts as a mini page editor so you can type in text, change the formatting, add bullet points and numbered lists, and more.

Adding shortcodes and HTMTL to your website's navigation

There’s also a checkbox that will add a link to your privacy policy page

Next, you might like to add social media icons to your WordPress menu. These icons will appear in a row at the bottom of the fullscreen menu.

An example of a fullscreen mobile menu

To add these icons, simply click to expand the ‘Social Icon 1’ box.

You can now type in a title for the icon, such as ‘Facebook.’

Adding social icons to your blog or website

After that, click on the arrow next to ‘Social Icon’ and choose the icon that you want to show to mobile visitors.

Finally, type the address you want to use into the ‘Social URL’ field.

Adding Facebook, Twitter, and other social platforms to your website or blog

To add more icons, simply click the ‘Add Another Icon’ button.

Finally, you may want to add a WordPress search bar to help visitors find what they’re looking for. To do this, simply check the box next to ‘Add Search Bar.’

How to add a search bar to your mobile website

By default, the plugin will show a ‘Search something…’ message. However, you can replace this with your own custom messaging by typing into the ‘Search input placeholder’ field.

For example, if you run a WooCommerce store then you may want to use text such as ‘Start shopping’ or ‘Search for products.’

When you’re happy with how the menu is set up, click on the ‘Save Changes’ button.

Making a mobile responsive menu live on your website

Now, simply visit your website using a mobile device to see the fullscreen menu in action.

You can also preview the mobile version of your website using the WordPress theme customizer.

Bonus: How to Add a Mobile-Responsive Menu to Landing Pages

If you’re creating a landing page or sales page, then you’ll want the design to look just as good on mobile devices as it does on desktop.

With that in mind, we recommend creating the page using SeedProd. SeedProd is the best page builder plugin and comes with more than 180 professionally-designed templates.

Choosing a SeedProd template

After creating a design using SeedProd, you can add a mobile-responsive menu to the page using SeedProd’s ready-made Nav Menu block. This block allows you to create separate menus for both menu devices and desktop.

In this way, you can use a different layout and even show different links depending on the user’s device.

To learn more, please see our guide on how to add custom navigation menus in WordPress.

After adding the Nav block to your design, simply click on the ‘Advanced’ tab.

Creating mobile responsive navigation using SeedProd

Here, click to expand the ‘Device Visibility’ section.

After that, click on the ‘Hide on Desktop’ toggle to activate it. Now, this menu will only appear on mobile devices.

Creating a mobile responsive menu using SeedProd

You can now add links and change the menu’s layout using the settings in the left-hand menu.

We hope this article helped you learn how to create a mobile-ready responsive WordPress menu. You may also want to see our guide on how to increase your blog traffic, or see our expert pick of the best analytics solutions for WordPress users.

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.

The post How to Create a Mobile-Ready Responsive WordPress Menu first appeared on WPBeginner.

How to Display Different Sidebar for Each Post and Page in WordPress

Do you want to display different sidebars for certain posts and pages on your WordPress site?

A lot of the time, you will want to show the same sidebar across your entire website or blog. However, sometimes you may need to show different sidebar content on some of your posts and pages.

In this article, we will show you how to create and display different sidebars for each post and page in WordPress.

How to Display Different Sidebar for Each Post and Page in WordPress

When Would You Need Different Sidebars in WordPress?

Many WordPress themes have a sidebar where you can add useful widgets and content. For example, many sites add a search bar to the sidebar or show a list of recent posts.

If your WordPress theme has a sidebar, then by default, it will look the same on all your posts, pages, categories, and archive pages.

However, you may want to display different sidebar widgets on certain posts and pages.

For example, you might show different content in the sidebar of your most popular posts or display ads that are more relevant to a particular page.

You could even use different contact forms depending on the page’s content.

Having said that, let’s see how to create and display a different sidebar for each post and page in WordPress. Simply use the quick links below to jump straight to the method you want to use:

Method 1: Displaying Different Sidebars for Each Post and Page in WordPress (Easy)

If your theme supports sidebar widgets, then you can easily create multiple sidebars using Lightweight Sidebar Manager. This plugin lets you build as many custom sidebars as you want and then assign them to different posts and pages. You can also add them to custom post types or assign a sidebar to all the pages or posts that have a specific category.

The first thing you need to do is install and activate the Lightweight Sidebar Manager plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to go to Appearance » Sidebars. To create the first sidebar, click on the ‘Add New’ button.

Adding custom sidebars to your WordPress website

You can now type in a title for the sidebar. This is just for your reference, so you can use anything you want.

With that done, open the ‘Sidebar To Replace’ dropdown menu and choose the location where you want to show the sidebar. The options you see may vary depending on your WordPress theme

Replacing the built-in sidebar provided by your WordPress theme

Now, you can control where the sidebar appears by creating inclusion or exclusion rules. 

To create an inclusion rule, just open the ‘Display On’ dropdown and choose the pages, posts, custom post types, or categories where you want to use the sidebar. 

For example, you might add the sidebar to a specific page, such as your 404 error page or the author archive.

Adding a custom sidebar to the WordPress 404 page

Another option is using the sidebar for a particular page, post, or category by selecting ‘Specific Pages/Posts/Taxonomies.’

This adds a box where you can type in the page, post, or category.

Creating a custom sidebar for WordPress categories

To create more inclusion rules, simply click on the ‘Add Display’ Rule button.

This adds a section where you can create the new inclusion rule.

Adding display rules for custom sidebars in WordPress

If you prefer, then you can create exclusion rules instead. For example, you may want to show the sidebar on every page except the homepage. 

You can also combine inclusion and exclusion rules to control exactly where the sidebar appears on your WordPress website.

To create an exclusion rule, just click on the ‘Add Exclusion Rule’ button.

Displaying different sidebars for pages and posts in WordPress

In the new ‘Do Not Display On’ section, open the dropdown menu and select the page or post that shouldn’t use this sidebar. 

You can also exclude the sidebar from pages that have a specific category by following the same process described above.

Displaying different sidebar for each page and post in WordPress

After deciding where the sidebar will appear on your WordPress blog, you may want to show different content to different users.

For example, if you have a membership site, then you might use a different sidebar for visitors compared to logged-in members. 

To do this, open the ‘User’ dropdown and choose a role from the dropdown menu. Now, only people with this specific user role will see the sidebar. 

Displaying different sidebar widgets on each WordPress page or post

Finally, you may want to type in an optional description. This will only appear in the WordPress dashboard, so it’s a good way to share information with other admins or users on a multi-author WordPress blog

If you are going to create lots of sidebars, then you can also use this field to leave yourself notes and helpful reminders.

Adding a helpful description to a custom sidebar in WordPress

When you are happy with the information you have entered, simply click on ‘Publish.’

With that done, go to Appearance » Widgets. You will now see all the widget-ready areas that your theme supports by default, plus the new sidebar you created in the previous step.

Adding content to a sidebar or similar widget-ready area

You can now go ahead and add widgets to the sidebar, just like any other widget-ready area. 

For step-by-step instructions, please see our guide on how to add and use widgets

Adding content to a custom WordPress sidebar

When you are happy with how the sidebar is set up, click on ‘Update.’

Now, if you visit your WordPress blog, you will see the new sidebar live.

An example of a custom WordPress sidebar, created using a plugin

To create more custom sidebars, simply keep repeating these steps. 

Method 2: Creating a Different Sidebar With a Page Builder Plugin (Works With Any WordPress Theme)

If your theme doesn’t support sidebars, then you can still create different sidebars using a drag and drop page builder plugin.

SeedProd is the best landing page builder plugin for WordPress. With this plugin, you can create any type of custom page without writing any code. It also has dozens of professional site kits and templates that you can easily edit and fine-tune using the drag-and-drop builder.

When designing a custom page, you can choose a layout that has a sidebar.

Choose a Layout with a Sidebar

You then simply find the blocks you want to show in that sidebar and add them using drag and drop.

SeedProd has all the blocks and features you’d expect from a powerful page builder, such as optin forms, social profiles, countdown timers, contact forms, buttons, various content blocks, and more. This makes it easy to create powerful and unique sidebars for your WordPress blog.

Drag the Blocks You Wish to Use Right onto the Sidebar

To learn how to use the SeedProd page builder plugin on your website, you can see our guide on how to create a custom page in WordPress.

We hope this article helped you learn how to add different sidebars to each post or page in WordPress. You may also want to learn how to create a custom Instagram feed in WordPress or see our expert picks for the best block themes for full site editing.

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.

The post How to Display Different Sidebar for Each Post and Page in WordPress first appeared on WPBeginner.

How to Display Any Number of Posts in a WordPress Loop

Do you want to show multiple blog posts in a WordPress loop?

Using the loop, WordPress processes each of the posts to be displayed on the current page. It formats them according to how they match specified criteria within the loop tags.

In this article, we will show how to display any number of posts in a WordPress loop.

How to display any number of posts in a WordPress loop

What Is the WordPress Loop?

The loop is used by WordPress to display each of your posts. It is PHP code that’s used in a WordPress theme to show a list of posts on a web page. It is an important part of WordPress code and is at the core of most queries.

In a WordPress loop, there are different functions that run to display posts. However, developers can customize how each post is shown in the loop by changing the template tags.

For example, the base tags in a loop will show the title, date, and content of the post in a loop. You can add custom tags and display additional information like the category, excerpt, custom fields, author name, and more.

The WordPress loop also lets you control the number of blog posts that you show on each page. This can be helpful when designing an author’s template, as you can control the number of posts displayed in each loop.

That being said, let’s see how to add any number of posts to a WordPress loop.

Adding Any Number of Posts in a WordPress Loop

Normally, you can set the number of posts to be displayed in the loop from your WordPress admin panel.

Simply head to Settings » Reading from the WordPress dashboard. By default, WordPress will show 10 posts.

Reading settings WordPress

However, you can override that number by using a Super Loop, which will allow you to display any number of posts in that specific WordPress loop.

This will allow you to customize the display settings of your pages, including author profiles, sidebars, and more.

First, you will need to open a template file where you would like to place the posts and then simply add this loop:

<?php
// if everything is in place and ready, let's start the loop
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

	// to display 'n' number of posts, we need to execute the loop 'n' number of times
	// so we define a numerical variable called '$count' and set its value to zero
	// with each iteration of the loop, the value of '$count' will increase by one
	// after the value of '$count' reaches the specified number, the loop will stop
	// *USER: change the 'n' to the number of posts that you would like to display

	<?php static $count = 0;
	if ( $count == "n" ) {
		break;
	} else { ?>

		// for CSS styling and layout purposes, we wrap the post content in a div
		// we then display the entire post content via the 'the_content()' function
		// *USER: change to '<?php the_excerpt(); ?>' to display post excerpts instead

		<div class="post">
			<?php the_title(); ?>
			<?php the_content(); ?>
		</div>

		// here, we continue with the limiting of the number of displayed posts
		// each iteration of the loop increases the value of '$count' by one
		// the final two lines complete the loop and close the if statement

		<?php $count ++;
	} ?>
<?php endwhile; ?>
<?php endif; ?>

Note: You will need to replace the value of ‘n‘ in the if ( $count == "n" ) part of the code and choose any number.

An easy way to add this code to your WordPress website is by using the WPCode plugin. It is the best code snippet plugin for WordPress that helps you manage custom code.

By using WPCode, you don’t have manually edit theme template files and risk breaking something. The plugin will automatically insert the code for you.

First, you need to install and activate the free WPCode plugin. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you can head to Code Snippets » + Add Snippet from your WordPress dashboard. Next, you need to select the ‘Add Your Custom Code (New Snippet)’ option.

Add new snippet

After that, simply paste the custom code for the WordPress loop that we showed you above into the ‘Code Preview’ area.

You will also need to enter a name for your code and set the ‘Code Type’ to ‘PHP Snippet’.

Add custom loop code to WPCode

Next, you can scroll down to the ‘Insertion’ section and choose where you would like to run the code.

By default, WPCode will run it everywhere on your WordPress website. However, you can change the location to a specific page or use a shortcode to insert the code.

Edit insertion method for code

For this tutorial, we will use the default ‘Auto Insert’ method.

When you are done, don’t forget to click the toggle at the top to make the code ‘Active’ and then click the ‘Save’ button. WPCode will now deploy the code on your WordPress blog and display the specified number of posts in the WordPress loop.

We hope this article helped you learn how to display any number of posts in a WordPress loop. You may also want to see our guide on how to exclude sticky posts from the loop in WordPress and our expert picks for the 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.

The post How to Display Any Number of Posts in a WordPress Loop first appeared on WPBeginner.

How to Use Shortcodes in Your WordPress Themes

Do you want to use shortcodes in your WordPress theme?

Normally, you will use shortcodes inside content areas like posts, pages, or sidebar widgets. However, sometimes you may want to add a shortcode inside your WordPress theme.

In this article, we will show you how to easily add any shortcode to your WordPress theme.

How to use shortcodes in your WordPress themes

Why Use Shortcodes in Your WordPress Themes?

Shortcodes allow you to add all kinds of features to your website, including image galleries, forms, social media feeds, and much more.

WordPress comes with a few built-in shortcodes, but there are also many popular WordPress plugins that add shortcodes to your site.

For example, WPForms has easy-to-use blocks, but it also provides shortcodes so that you can add forms to other areas of your website.

An example of a WordPress shortcode, provided by WPForms

Most of the time, you will add shortcodes inside content areas like posts and pages.

To learn more, please see our complete guide on how to add a shortcode in WordPress.

Adding a shortcode block to a WordPress page or post

However, sometimes you may want to use a shortcode inside your WordPress theme files.

This allows you to add dynamic elements to areas you can’t edit using the standard WordPress post editor, such as your 404 page. It’s also an easy way to use the same shortcode on multiple pages.

For example, you might add a shortcode to your theme’s Page or Post template.

With that in mind, let’s see how you can use shortcodes in your WordPress theme. Simply use the quick links below to jump straight to the method you want to use.

Method 1: Using the Full-Site Editor (Block Themes Only)

The easiest way to use shortcodes in your WordPress theme is by using the full site editor. This allows you to add a Shortcode block to any part of your website.

However, this method only works with block-based themes like Hestia Pro. If you are not using a block-enabled theme, then you will need to use a different method instead.

To get started, head over to Themes » Editor in the WordPress dashboard.

Opening the WordPress full-site editor

By default, the full site editor shows your theme’s home template, but you can add shortcodes to any template or template part, such as the header or footer.

To see all the available options, just select either ‘Templates’ or ‘Template Parts’.

Adding a shortcode to a WordPress template

You can now click on the template or template part you want to edit.

As an example, we will add a shortcode to the 404 page template, but the steps will be exactly the same no matter which template you select.

Adding a shortcode to a WordPress theme using a full-site editor (FSE)

WordPress will now show a preview of the template or template part.

To add a shortcode, go ahead and click on the small pencil icon.

Editing a WordPress theme's 404 template using the full-site editor (FSE)

With that done, click on the blue ‘+’ icon in the top left corner.

In the search bar, you need to type in ‘Shortcode’.

Adding a shortcode block to a WordPress theme

When the right block appears, drag and drop it onto the theme template.

You can now either paste or type the shortcode that you want to use.

Adding Shortcode blocks to a WordPress theme

After that, go ahead and click on the ‘Save’ button.

Now, simply visit your WordPress blog to see the shortcode in action.

An example of a shortcode, on a 404 page template

Method 2: Editing Your WordPress Theme Files (Works With Any WordPress Theme)

You can also add shortcodes to your WordPress theme by editing the theme files. This method is more advanced, but it works with every WordPress theme.

If you haven’t added code to your site before, then check out our step-by-step guide on how to copy and paste code in WordPress.

You can modify the individual theme files directly, but this makes it difficult to update your WordPress theme without losing customization. For this reason, we recommend overriding the theme files by creating a child theme.

If you are creating a custom theme, then you can add or modify the code in your existing theme files.

When editing your theme files, you can’t add the shortcode in the same format you use with standard content areas. Instead of seeing the shortcode’s output, you will see the shortcode itself on the screen.

This happens because WordPress doesn’t execute shortcodes inside theme template files. Instead, you will need to explicitly tell WordPress to run the shortcode using the do_shortcode function.

For more information, please see our guide on how to easily add custom code.

Here’s an example of the code you will add to your WordPress theme files:

echo do_shortcode('[gallery]');

Simply replace ‘gallery’ with the shortcode you want to use.

If you are not sure where to add the shortcode, then please see our beginner’s guide to the WordPress template hierarchy.

If you are adding a shortcode with extra parameters, then the code snippet will also change a little bit.

Imagine you have created a contact form using WPForms. In this case, you will need to use the standard WPForms shortcode plus the form’s ID:

echo do_shortcode("[wpforms id='92']");

Troubleshooting: What to Do When do_shortcode Isn’t Working

Sometimes, you may add a shortcode to a theme file, but the code’s output doesn’t appear on your WordPress website. This usually means the shortcode depends on a WordPress plugin or some other code on your website.

If the do_shortcode function is not working, then make sure the plugin providing the shortcode is installed and activated by going to Plugins » Installed Plugins.

In the following image, WPForms is installed but deactivated, so the echo do_shortcode code won’t work.

How to instal and activate a WordPress plugin

You can also check whether a shortcode is available for you to use by adding the shortcode_exists() function to your index.php file.

In the following snippet, we are checking whether the WPForms snippet is available to use on our website:

if ( shortcode_exists( 'wpforms' ))  {
  echo do_shortcode("[[wpforms id='147']]");
}

If you still don’t see the shortcode output on your website, then try clearing the WordPress cache, as you may be seeing an outdated version of your site.

Method 3: Creating Your Own WordPress Theme (Fully Customizable)

Another option is to create a custom WordPress theme. This is a more advanced method, but it allows you to add as many shortcodes as you want to any area of your WordPress theme. You can also make other changes to create a theme that has exactly the features and design you want.

In the past, you would need to follow complicated WordPress tutorials and write code to build a custom WordPress theme. However, it’s now possible to create a custom theme without writing a single line of code using SeedProd.

SeedProd is the best WordPress page builder and also comes with a theme builder. This allows you to design your own themes using drag and drop.

SeedProd's advanced theme builder feature

For step-by-step instructions, please see our guide on how to create a custom WordPress theme (without any code).

After creating a theme, you can add shortcodes to any part of your WordPress website by going to SeedProd » Theme Builder.

Custom WordPress theme templates

Here, find the template where you want to use a shortcode.

Then, just hover your mouse over that template and click on ‘Edit Design’ when it appears.

Creating a custom theme using SeedProd

This will open the template in SeedProd’s drag and drop page builder.

In the left-hand menu, scroll to the ‘Advanced’ section. Here, find the Shortcode block and drag it onto your layout.

Adding a Shortcode block to a theme using SeedProd

In the live preview, simply click to select the Shortcode block.

You can now add your shortcode into the ‘Shortcode’ box.

Adding a contact form to a WordPress theme using shortcode

By default, SeedProd doesn’t show the shortcode output in the live preview.

To see your shortcode in action, click on the ‘Show Shortcode Option’ toggle.

Previewing the shortcode output in SeedProd

After that, you may want to add some styling to the shortcode output by selecting the ‘Advanced’ tab.

Here, you can change the spacing, add custom CSS, and even add CSS animation effects.

Styling shortcode output using the SeedProd theme builder

When you are happy with how the page looks, just click the ‘Save’ button.

After that, select ‘Publish’ to make the shortcode live.

Publishing a custom WordPress theme using SeedProd

You can now visit your website to see the custom shortcode in action.

We hope this tutorial helped you learn how to use shortcodes in your WordPress themes. You may also want to check out our guide on how to create a landing page in WordPress and our expert picks for the best social media plugins for WordPress.

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.

The post How to Use Shortcodes in Your WordPress Themes first appeared on WPBeginner.

How to Change the Gravatar Image Size in WordPress

Do you want to change the Gravatar image size in WordPress?

Gravatar is a service that connects a user’s email address with a picture. WordPress themes show Gravatars at a set size, but you may prefer to make these images smaller or larger to better suit your website’s design.

In this article, we will show you how to change the size of Gravatar images in WordPress.

How to change the Gravatar image size in WordPress

Why Change the Gravatar Image Size in WordPress?

Gravatar stands for Globally Recognized Avatar. It’s a web service that allows you to create a profile and associate avatar images with your email address.

Most WordPress themes show a Gravatar next to the user’s comment. Some themes also display a Gravatar in the author bio box.

Even if a user doesn’t have a Gravatar account, then your site will still show one of the default WordPress Gravatars.

The default WordPress Gravatar

Sometimes you may want to change the size of your theme’s Gravatars. For example, you may want to make them bigger so that they stand out. This can draw the visitor’s attention to your site’s comment section and help you get more comments on your WordPress posts.

Having said that, let’s take a look at how you can change the Gravatar image size on your WordPress site. Simply use the quick links below to jump to the method you want to use.

Method 1: Change Gravatar Size Using the WordPress Full-Site Editor (Block Themes Only)

If you are using a block-based theme such as ThemeIsle Hestia Pro or Twenty Twenty-Three, then you can change the Gravatar size using the full-site editor.

This method doesn’t work with all themes, so if you are not using a block-enabled theme, then we recommend using method 2 instead.

In the WordPress dashboard, go to Appearance » Editor.

Opening the WordPress full-site editor (FSE)

In the left-hand menu, you can choose whether to edit a template or template part.

To change the Gravatar size for WordPress comments, you will typically select ‘Template Parts’ from the left-hand menu.

Template parts, in a WordPress block-enabled theme

After that, just click on ‘Comments.’

You can now click to select the Comments template part.

The 'comments' template part in the WordPress full site editor

This opens a new menu with settings you can use to customize the comments template part.

You can now go ahead and click on any of the Gravatars in the live preview.

Changing the Gravatar image size using the full site editor

In the right-hand menu, you can select the ‘Block’ tab if it isn’t already selected.

You can now make the Gravatars bigger or smaller by dragging the ‘Image Size’ slider.

Changing the size of a Gravatar using the full site editor (FSE) in WordPress

As you move the slider, all the Gravatars will update automatically, so you can try different sizes to see what looks the best.

When you are happy with the changes you have made, click on the ‘Save’ button.

Saving resized Gravatars using the full-site editor (FSE)

Now if you visit any comment section on your WordPress website, you will see the changes live.

Method 2: Change Gravatar Size for WordPress Comments (Works With All Themes)

If you are not using a block-enabled WordPress theme, then you can change the Gravatar size for WordPress comments using code.

This method requires you to edit theme files, so it’s not the most beginner-friendly option. However, this method should work for most WordPress themes.

If you edit your WordPress theme files directly, then those changes will disappear the next time you update your theme. With that being said, we recommend creating a child theme, as this allows you to update your WordPress theme without losing customization.

After creating a child theme, you will need to connect to your WordPress site using an FTP client such as FileZilla, or you can use the file manager of your WordPress hosting cPanel.

If you are a SiteGround customer, then you can use the Site Tools dashboard instead.

If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP.

Once you are connected, you need to go to /wp-content/themes/ and open the folder for your current WordPress theme.

An example of an FTP client

Once here, open the comments.php file and look for a wp_list_comments function. Inside this function, you will find theavatar_size, which sets the size of the Gravatar.

Here’s an example of how this might look:

<?php
wp_list_comments(
    array(
        'avatar_size' => 60,
        'style'       => 'ol',
        'short_ping'  => true,
    )
);
?>

You can simply change the avatar_size to the size you want to use. In the code snippet above, this would mean changing 60 to another number.

Gravatars are square, so WordPress will use the same value for the image’s width and height. This means that you only need to type in one number.

After making this change, make sure to save and upload the file back to your WordPress hosting account. When you are finished, you can visit your WordPress blog to see the change in action.

If the Gravatar image hasn’t changed, then it may be due to the cache. To learn more, please see our guide on how to fix WordPress not updating right away.

If the Gravatar still doesn’t change, then your theme’s CSS could be overriding the settings in the comments.php file.

You can see whether this is the case using your browser’s Inspect tool. The steps will vary depending on which browser you are using, but on Chrome, you can simply right-click or Ctrl-click the Gravatar and then select ‘Inspect’.

Inspecting a WordPress Gravatar using Google Chrome

This will show the page’s HTML and CSS code in a new panel.

In this code, you need to look for the height and width values.

Editing a WordPress Gravatar using Chrome's Inspect tool

If the size is different from what you specified in the comments.php file, then this means your theme’s style.css file is overriding your changes.

If this is the case, then simply switch back to your FTP client. You can now open the theme’s folder and then open the style.css file.

Opening a WordPress theme's style.css file using an FTP client

Here, search for a block of code that has the word avatar.

You will typically find this in a comment-author .avatar CSS class, such as this:

.comment-author .avatar {
    height: 42px;
    position: relative;
    top: 0.25em;
    width: 42px;
}

You can now go ahead and change the width and height to the values you want for your Gravatars.

After that, simply save your changes. Now if you visit your WordPress blog or website, you will see your updated Gravatar images.

At this point, you may be wondering why we recommend trying to change the Gravatar size in the comments.php file before using the easier CSS method.

Firstly, CSS can sometimes make the Gravatars look blurry, especially if you make the avatars much larger than the original image. Secondly, changing the image size in comments.php often helps your site to load faster.

For more on this topic, see our ultimate guide to boost WordPress speed and performance.

Method 3: How to Change Gravatar Size for Author Bios

If you run a multi-author WordPress site, then an author box can help readers learn more about the post’s author.

If you want to add this feature to your website, then check out our guide on how to add an author info box in WordPress posts.

Many author bios show the writer’s Gravatar along with their bio. To change the default Gravatar size in your author bio boxes, you need to find the theme file that adds the bio.

Simply connect to your site using an FTP client such as FileZilla or the file manager of your WordPress hosting. Once you are connected, go to /wp-content/themes/ and open the folder for your current WordPress theme.

After that, you need to open the template-parts folder.

Editing template parts in a WordPress theme using an FTP client

You now need to find the file that contains the get_avatar code. You will often find this code in a template part file called author-bio.php, single.php file, functions.php file, or similar.

Here’s an example of how this code might look:

<div class="author-bio <?php echo get_option( 'show_avatars' ) ? 'show-avatars' : ''; ?>">
        <?php echo get_avatar( get_the_author_meta( 'ID' ), '85' ); ?>

In the snippet above, you can simply change the number 85 to the size you want to use.

In other themes, the code may look like this:

get_avatar( get_the_author_meta( 'user_email' ), 85);

You can simply replace the number with the value you want to use to make the Gravatar bigger or smaller.

After changing the size, don’t forget to save your changes. You can then visit your website to see the new author bio box in action.

If the Gravatars haven’t changed, then you will need to search for the avatar class in the style.css file by following the same process described above. Once you find this class, you can type in the new Gravatar height and width values.

We hope this tutorial helped you learn how to change the Gravatar image size in WordPress. You may also want to learn how to display round Gravatar images in WordPress or check out our list of the best landing page plugins.

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.

The post How to Change the Gravatar Image Size in WordPress first appeared on WPBeginner.

How to Customize the Background Color of WordPress Block Editor

Do you want to change the background color of the WordPress block editor for admins?

Sometimes when working on a custom client project, you may want to change the Gutenberg editor background color in WordPress to match their brand colors.

In this article, we’ll show you how to easily customize the background color of the WordPress block editor for admin area.

Changing the background color of WordPress block editor

Note: This guide covers changing the editor color in WordPress admin. If you’re looking to change the background color in WordPress front-end, then please see our tutorial on how to change background color in WordPress.

Why Change the Background Color of the Block Editor in WordPress?

You may want to change the background color of the WordPress block editor for a number of reasons.

For instance, most modern WordPress themes use the same background color for the block editor as the live website including Astra, OceanWP, GeneratePress, and more.

However, if your WordPress theme doesn’t use the same colors, then the appearance of your post inside the editor will look quite different from what your users will see on the live website.

Another reason for changing the background color could be personal preference.

For instance, by default, the block editor uses a plain white background. Some users may find it a bit stressful to look at the white screen for long hours. Eye strain can be a real issue for many people, and the default white background is not easy on the eyes.

Default block editor

That being said, let’s see how you can easily change the WordPress editor background color.

How to Change the WordPress Editor Background Color

You can easily change the WordPress editor background color by adding custom code to your theme’s functions.php file.

However, keep in mind that even the smallest error in the code can break your website and make it inaccessible. That’s why we recommend using the WPCode plugin. It’s the best WordPress code snippets plugin on the market and is the easiest and safest way to add custom code to your WordPress website.

First, you need to install and activate the free WPCode plugin. For more instructions, please see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Code Snippets » + Add Snippets page from the admin sidebar.

From here, you have to click on the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

Add new snippet

This will take you to the ‘Create Custom Snippet’ page where you can start by typing a name for your code snippet. This is just for you and can be anything that will help you identify the code.

Next, you need to choose ‘PHP Snippet’ as the ‘Code Type’ from the dropdown menu on the right.

Choose PHP Snippet option as the code type for changing editor background color

After that, you need to copy and paste the following code into the ‘Code Preview’ box.

add_action( 'admin_footer', function() {
	?>
	<style>
		.editor-styles-wrapper {
			background-color: #bee0ec;
		}
	</style>
	<?php
});

Next, you need to look for the following code in the PHP snippet you just pasted.

background-color: #bee0ec;

Then, you have to add the hex code of your preferred color next to the background color option. If you don’t want to use a hex code, you can use some basic color names such as ‘white’ or ‘blue’ instead.

Paste the code snippet for changing the editor background color

After that, you need to scroll down to the ‘Insertion’ section and choose the ‘Auto Insert’ option.

Next, you need to select the ‘Location’ of the code snippet as ‘Admin Only’ from the dropdown menu.

Choose the insertion method and location of the code snippet

After that, you need to scroll back to the top of the page and toggle the ‘Inactive’ switch to ‘Active.’

Finally, don’t forget to click on the ‘Save Snippet’ button to save your changes.

Save the code snippet for changing the background color

Now, go visit the block editor from the admin sidebar.

This is how the block editor looked on our site after adding the CSS code snippet.

Editor color preview

We hope this article helped you learn how to easily change the WordPress editor background color. You may also want to see our ultimate guide on 85+ time saving WordPress shortcuts, or take a look at our top picks for the best WordPress page builder plugins.

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.

The post How to Customize the Background Color of WordPress Block Editor first appeared on WPBeginner.

How to Fade Images on Mouseover in WordPress (Simple & Easy)

Do you want to fade images on mouseover in WordPress?

A simple fade-in or fade-out animation when a user moves their mouse over an image can make your site more engaging. It also encourages visitors to interact with your content, which can keep them on your site for longer.

In this article, we’ll show you how to add a fade image effect on mouseover in WordPress.

How to fade images on mouseover in WordPress

Why Fade Images on Mouseover in WordPress?

Animations are an easy way to make your website more interesting, and can even draw the visitor’s attention toward your page’s most important content, such as your website logo or a call to action.

There are lots of different ways to use CSS animations in WordPress, but adding a hover effect to images is particularly effective. The fade animation means your images will slowly appear or disappear when visitors hover over them.

Adding a fade animation to WordPress

This encourages people to interact with your images, and can even add a storytelling element to the page. For example, different images might fade in and out as the visitor moves around the page.

Unlike some other animations, the fade image on mouseover effect is subtle so it won’t negatively impact the visitor’s reading experience or any image optimization you’ve done.

With that said, let’s show you how to add a fade to your images on mouseover in WordPress.

Adding Image Fade on Mouseover to all WordPress Images

The easiest way to add a fade effect to all your images is by using WPCode. This free plugin allows you to easily add custom code in WordPress without having to edit your theme files.

With WPCode, even beginners can edit their website’s code without risking mistakes and typos that can cause many common WordPress errors.

The first thing you need to do is install and activate the free WPCode plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, head over to Code Snippets » Add Snippet.

Adding custom code to your WordPress website with WPCode

Here, simply hover your mouse over ‘Add Your Custom Code.’

When it appears, click on ‘Use snippet.’

Creating a custom CSS snippet on your WordPress website

To start, type in a title for the custom code snippet. This can be anything that helps you identify the snippet in the WordPress dashboard.

We need to add custom CSS to WordPress, so open the ‘Code Type’ dropdown and select ‘CSS Snippet.’

Add a fade on mouseover animation to images using WPCode

In the code editor, add the following code snippet:

.post img:hover{
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
-webkit-transition: all 2s ease;
-moz-transition: all 2s ease;
-ms-transition: all 2s ease;
-o-transition: all 2s ease;
transition: all 2s ease;
}

This code snippet will fade each image for 2 seconds when the user hovers their mouse over it. To make the image fade slower, simply replace ‘2s ease’ with a higher number. If you want to make the picture fade faster, then use ‘1s ease’ or smaller.

You can also make the ‘opacity’ higher or lower by changing the opacity:0.6 line.

If you change any of these numbers then make sure you change them across all the properties (webkit, moz, ms, and o), so the fade effect looks the same on every browser.

When you’re happy with the snippet, scroll to the ‘Insertion’ section. WPCode can add your code to different locations, such as after every post, frontend only, or admin only.

To add a fade effect to all your images, click on ‘Auto Insert.’ Then, open the ‘Location’ dropdown menu and choose ‘Site Wide Header.’

Inserting custom CSS across your WordPress website

After that, you’re ready to scroll to the top of the screen and click on the ‘Inactive’ toggle, so it changes to ‘Active.’

Finally, click on ‘Save Snippet’ to make the CSS snippet live.

Adding a fade effect to images using CSS

Now, if you hover the mouse over any image on your WordPress website, you’ll see the fade effect in action.

Adding Image Fade Animations to Individual Pages

Using a fade effect for every single image can become distracting, especially if you’re running a photography website, a stock photo store, or any other site that has lots of images.

With that in mind, you may want to use fade effects on a specific page or post only.

The good news is that WPCode allows you to create custom shortcodes. You can place this shortcode on any page, and WordPress will show fade effects on that page only.

To do this, simply create a custom code snippet and add the fade animation code following the same process described above. Then, click on the ‘Save snippet’ button.

Fade images on mouseover in WordPress using custom code

After that, scroll to the ‘Insertion’ section, but this time select ‘Shortcode.’

This creates a shortcode that you can add to any page, post, or widget-ready area.

Creating a shortcode in WPCode

After that, go ahead and make the snippet live following the same process described above.

You can now go to any page, post, or widget-ready area and create a new ‘Shortcode’ block. Then, simply paste the WPCode shortcode into that block.

How to create fade animations for images using shortcode

For more information on how to place the shortcode, please see our guide on how to add a shortcode in WordPress.

With that done, either click on the ‘Update’ or ‘Publish’ button to make the shortcode live. You can then visit that page, page, or widget-ready area to see the fade on mouseover effect.

Adding Image Fade Animations to Featured Images

Another option is to add fade animations to your featured images or post thumbnails. These are the post’s primary image and they often appear next to the heading on your home page, archive pages, and other important areas of your website.

By fading featured images on mouseover, you can make your site more eye-catching and engaging, without animating every single image across your WordPress blog or website.

To add a fade animation to your post thumbnails, simply create a new custom code snippet following the same process described above.

Adding a fade on mouseover effect to individual images

However, this time add the following code to the editor:

img.wp-post-image:hover{
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
-webkit-transition: all 2s ease;
-moz-transition: all 2s ease;
-ms-transition: all 2s ease;
-o-transition: all 2s ease;
transition: all 2s ease;
}

After that, scroll to the ‘Insertion’ box and select ‘Auto Insert.’ Then, open the ‘Location’ dropdown menu and choose ‘Site Wide Header.’

Adding an animation to images on mouseover

After that, you can go ahead and make the code snippet live using the same process described above.

Now, you can hover the mouse over any featured image to see the fade animation in action.

If you want to add even more image mouseover effects, then see our guide on how to add image hover effects in WordPress.

Bonus: Animate Any Image, Text, Button, and More

Fade effects are a fun way to make images more interesting, but there are lots more ways to use animations in WordPress. For example, you might use flipbox animations to reveal text when a visitor hovers over an image, or use zoom effects so users can explore a picture in more detail.

If you want to try different effects, then SeedProd has over 40 animations that you can add to images, text, buttons, videos, and more. You can even animate entire sections and columns with just a few clicks.

Inside the SeedProd editor, simply click on the content you want to animate, and then select the ‘Advanced’ tab in the left-hand menu.

Adding fade animations using SeedProd

You can then go ahead and click to expand the ‘Animation Effects’ section.

After that, simply choose an animation from the ‘Entrance Animation’ dropdown, including a wide range of different fade effects.

Adding animations to WordPress using SeedProd

For more information, please see our guide on how to create a landing page with WordPress.

We hope this article helped you learn how to fade images on mouseover in WordPress. You may also want to see our guide on how to choose the best web design software, and our expert picks of the best WordPress popup plugins.

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.

The post How to Fade Images on Mouseover in WordPress (Simple & Easy) first appeared on WPBeginner.

How to Remove the Powered by WordPress Footer Links

Do you want to remove the ‘powered by WordPress’ footer links on your site?

By default, most WordPress themes have a disclaimer in the footer, but this can make your site look unprofessional. It also leaves less space for your own links, copyright notice, and other content.

In this article, we will show you how to remove the powered by WordPress footer links.

How to remove the powered by WordPress footer links

Why Remove the WordPress Footer Credits?

The default WordPress themes use the footer area to show a ‘Proudly powered by WordPress’ disclaimer, which links to the official WordPress.org website.

The Powered by WordPress disclaimer

Many theme developers take this further and add their own credits to the footer.

In the following image, you can see the disclaimer added by the Astra WordPress Theme.

The Astra footer disclaimer

While great for the software developers, this ‘Powered by….’ footer can make your site seem less professional, especially if you’re running a business website.

It also lets hackers know that you’re using WordPress, which could help them break into your site.

For example, if you’re not using a custom login URL, then hackers can simply add /wp-admin to your site’s address and get to your login page.

This disclaimer also links to an external site, so it encourages people to leave your website. This can have a negative impact on your pageviews and bounce rate.

Is it legal to remove WordPress footer credit links?

It is perfectly legal to remove the footer credits link on your site because WordPress is free, and it is released under the GPL license.

Basically, this license gives you the freedom to use, modify, and even distribute WordPress to other people.

Any WordPress plugin or theme that you download from the official WordPress directory is released under the same GPL license. In fact, even most commercial plugins and themes are released under GPL.

This means you’re free to customize WordPress in any way you want, including removing the footer credits from your business website, online store, or blog.

With that in mind, let’s see how you can remove the powered by WordPress footer links.

Video Tutorial

If you don’t want the video or need more instructions, then simply use the quick links below to jump straight to the method you want to use.

Method 1. Removing the ‘Powered by’ Link Using the Theme Settings

Most good theme authors know that users want to be able to edit the footer and remove the credit links, so many include it in their theme settings.

To see whether your theme has this option, go to Appearance » Customize in your WordPress admin dashboard.

Launching the WordPress Customizer

You can now look for any settings that let you customize your site’s footer, and then click on that option.

For example, the Astra theme has a section called ‘Footer Builder.’

Customizing the Astra theme disclaimer

If you’re using this theme, then simply click on the ‘Footer’ section and select ‘Copyright.’

Doing so will open a small editor where you can change the footer text, or even delete it completely.

How to remove the 'powered by WordPress' disclaimer

No matter how you remove the footer disclaimer, don’t forget to click on ‘Publish’ to make the change live on your site.

If you’re using a block theme, then you can remove the footer disclaimer using Full Site Editing (FSE) and the block editor.

This is a quick and easy way to remove the ‘Powered by’ credit across your entire site, although it won’t work with all themes.

To launch the editor, go to Appearance » Editor.

How to launch the FSE

Then, scroll to your website’s footer and click to select the ‘Powered by’ disclaimer.

You can now replace it with your own content, or you can even delete the disclaimer completely.

Editing the 'Proudly powered by WordPress' credit using the full site editor

When you’re happy with how the footer looks, simply click on ‘Save.’ Now if you visit your site, you’ll see the change live.

Method 3. How To Remove the ‘Powered by’ Disclaimer Using a Page Builder

Many WordPress websites use the footer to communicate important information, such as their email address or phone number. In fact, visitors might scroll to the bottom of your site looking specifically for this content.

With that in mind, you may want to go one step further and replace the ‘Powered by’ text with a custom footer. This footer could contain links to your social media profiles, links to your affiliate partners, a list of your products, or other important information and links.

You can see the WPBeginner footer in the following image:

An example of a WordPress footer

The best way to create a custom footer is by using SeedProd. It is the best page builder plugin and comes with over 180 professionally-designed templates, sections, and blocks that can help you customize every part of your WordPress blog or website.

It also has settings that allow you to create a global footer, sidebar, header, and more.

First, you need to install and activate SeedProd. For more details, see our step-by-step guide on how to install a WordPress plugin.

Note: There’s also a free version of SeedProd that allows you to create all kinds of pages using the drag-and-drop editor. However, we’ll be using the premium version of SeedProd since it comes with the advanced Theme Builder.

After activating the plugin, SeedProd will ask for your license key.

SeedProd license key

You can find this information under your account on the SeedProd website. After entering the key, click on the ‘Verify Key’ button.

Once you’ve done that, go to SeedProd » Theme Builder. Here, click on the ‘Add New Theme Template’ button.

The SeedProd theme builder

In the popup, type in a name for the new theme template.

Once you’ve done that, open the ‘Type’ dropdown and choose ‘Footer.’

Creating a custom footer with SeedProd

SeedProd will show the new footer template across your entire site by default. However, you can limit it to specific pages or posts using the ‘Conditions’ settings.

For example, you may want to exclude the new footer from your landing pages, so it doesn’t distract from your main call to action.

When you’re happy with the information you’ve entered, click on ‘Save.’

This will load the SeedProd page builder interface.

At first, your template will show a blank screen on the right and your settings on the left. To start, click on the ‘Add Columns’ icon.

The SeedProd theme builder editor

You can now choose the layout that you want to use for your footer. This allows you to organize your content into different columns.

You can use any layout you want, but for this guide, we’re using a three-column layout.

Choosing a layout for the WordPress footer

Next, you can edit the footer’s background so that it matches your WordPress theme, company branding, or logo.

To change the background color, simply click on the section next to ‘Background Color’ and then use the controls to choose a new color.

Changing the background color of a WordPress footer

Another option is to upload a background image.

To do this, either click on ‘Use Your Own Image’ and then choose an image from the WordPress media library, or click on ‘Use a stock image.’

Adding an image to a custom WordPress footer

When you’re happy with the background, it’s time to add some content to the footer.

Simply drag any block from the left-hand menu and drop it onto your footer.

Adding blocks to the WordPress footer

After adding a block, click to select that block in the main editor.

The left-hand menu will now show all of the settings for customizing the block.

The SeedProd advanced theme builder

Simply keep repeating these steps to add more blocks to your footer.

You can also change where each block appears by dragging them around your layout.

A custom footer, created using the SeedProd theme builder

When you’re happy with your design, click on the ‘Save’ button.

Then, you can select ‘Publish’ to complete your design.

Publishing the SeedProd template part

For your new footer to show up on your website, you’ll need to finish building your WordPress theme with SeedProd.

After building your theme, go to SeedProd » Theme Builder. Then, click on the ‘Enable SeedProd Theme’ switch.

Now, if you visit your website you’ll see the new footer live.

How to enable a custom WordPress theme

For a step-by-step guide, please see our guide on how to create a custom WordPress theme.

Method 4. Removing the WordPress Disclaimer Using Code

If you can’t see any way to remove or modify the footer credits in the WordPress customizer, then another option is to edit the footer.php code.

This isn’t the most beginner-friendly method, but it will let you remove the credit from any WordPress theme.

Before making changes to your website’s code, we recommend creating a backup so you can restore your site in case anything goes wrong.

Keep in mind that if you edit your WordPress theme files directly, then those changes will disappear when you update the theme. With that being said, we recommend creating a child theme as this allows you to update your WordPress theme without losing customization.

First, you need to connect to your WordPress site using an FTP client such as FileZilla, or you can use a file manager provided by your WordPress hosting company. 

If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP

Once you’ve connected to your site, go to /wp-content/themes/ and then open the folder for your current theme or child theme.

The FileZilla FTP client

Inside this folder, find the footer.php file and open it in a text editor such as Notepad.

In the text editor, look for a section of code that includes the ‘powered by’ text. For example, in the Twenty Twenty-One theme for WordPress, the code looks like this:

<div class="powered-by">
				<?php
				printf(
					/* translators: %s: WordPress. */
					esc_html__( 'Proudly powered by %s.', 'twentytwentyone' ),
					'<a href="' . esc_attr__( 'https://wordpress.org/', 'twentytwentyone' ) . '">WordPress</a>'
				);
				?>
			</div><!-- .powered-by -->

You can either delete this code entirely or customize it to suit your needs. For example, you may want to replace the ‘Proudly powered…’ disclaimer with your own copyright notice.

A custom disclaimer, created using FSE

After making your changes, save the file and upload it to your server. If you check your site, then the footer credit will have disappeared.

Warning! Avoid the CSS Method at All Costs!

Some WordPress tutorial sites may show you a CSS method that uses display: none to hide the footer credit links.

While it looks simple, it’s very bad for your WordPress SEO.

Many spammers use this exact technique to hide links from visitors while still showing them to Google, in the hopes of getting higher rankings.

If you do hide the footer credit with CSS, then Google may flag you as a spammer and your site will lose search engine rankings. In the worst-case scenario, Google may even delete you from their index so you never appear in search results.

Instead, we strongly recommend using one of the four methods we showed above. If you can’t use any of these methods, then another option is hiring a WordPress developer to remove the footer credit for you, or you might change your WordPress theme.

We hope this article helped you remove the powered by WordPress footer links. You may also want to check out our expert pick of the best contact form plugins and proven ways to make money online blogging with WordPress.

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.

The post How to Remove the Powered by WordPress Footer Links first appeared on WPBeginner.

Top 12 WordPress Themes for 2023

You may have an excellent business plan together with a good product or service to sell. But, the look and feel of your digital storefront doesn’t perfectly represent your brand. Then it simply isn’t going to contribute all that much to your business’s success.

That’s what makes WordPress such a vital element when building your website. WordPress’s website building tools and themes can give you what you’re looking for in your quest to achieve a seamless user experience.

There’s certainly no shortage of good WordPress themes out there. Themes that offer layouts for blogs, portfolios, an online store or a digital presence for a business.

Finding a top-quality WordPress theme can be a challenge. The following selection of 12 top WordPress themes for 2023 should make it easy for you to find one that best fits your needs. 

  1. Be – Multipurpose WordPress Theme

BeTheme is a supremely popular (250,000+ customers) multipurpose WordPress theme that features 40+ core features that gives users quick and easy access to an impressive array of powerful site-building tools, design aids, and options.

This, the biggest multipurpose WordPress theme of them all, features the responsiveness, flexibility, and performance you need to create websites that will showcase your business while leaving the competition in the dust.

  • Be’s library of 650+ customizable, responsive, and UI friendly pre-built websites make website building quick and easy
  • Be’s fast and user-friendly Be Builder enables you to view each element while customizing it
  • With Be’s WooCommerce Builder you can create shop and single product page layouts that feature impressive customer-centric options including product previews and sticky menus
  • The BeBuilder, Header Builder, Shortcode Generator, and a ton of design options give users all the flexibility they may need

BeTheme is Elementor ready, it is updated frequently, and its owners receive free lifetime updates. Click on the banner to find out more about this amazing theme’s powerful core features.

  1. Total WordPress Theme

Being able to easily create a website that does justice to your business is naturally a good thing. Being able to build your site your way makes everything even better, and that is what the Total WordPress theme does for you.

  • This aptly named theme features 50+ ready to use demos, 90+section templates, hundreds of live customer settings, and 100+ site builder elements together with an extended version of the WPBakery page builder.
  • Slider Revolution is included. Total integrates seamlessly with WooCommerce and features a multiplicity of WooCommerce styling options.
  • Layout options include boxed and full-width layouts, dynamic layouts, one-page sites, page and post designs, and advanced page settings
  • Total is compatible with most popular plugins, including bbPress, Uber Menu, Easy Digital Downloads, WPML, Yoast, and Ultimate Addons.

Click on the banner to learn more.

  1. Electro – WooCommerce Theme for Affiliates, Dropship and Marketplace Websites

The Electro WooCommerce theme gives you a complete design platform from which you can take your design vision and transform it into a pixel-perfect website. To help you along, Electro provides selections of home pages, dedicated mobile layouts, and multi-vendor marketplace pages.

  • Visual Composer is the page builder/editor of choice
  • The intuitive Admin Panel provides a choice of innovative WooCommerce layouts to showcase your product, show reviews, and add accessories that simplify user checkout
  • Choose from 9 awesome pre-defined colors, easily change, and arrange them, or make your own.
  • Electro features fast (1.25 sec) page loading times.
  • Electro was created for affiliate, dropship, and marketplace sites and is compatible with WPBakery and Elementor page builders.

Click on the banner to find out more. Be prepared to be impressed.

  1. TheGem – Creative and WooCommerce WordPress Theme

TheGem is a versatile creative WordPress theme with unlimited customizations, plenty of design & marketing focused features, collection of 400+ pre-built websites and fastest loading times.

  • TheGem’s versatile Theme Builder enables you to build every part of your website with Elementor or WPBakery
  • TheGem Blocks feature will speed up your site-building with huge library of 600+ page sections
  • Extensive toolbox with WooCommerce Builder, AJAX filters, advanced product grids will help you to create any kind of online shop

You’ll love the 5-star user support, as have 60,000 others. 

  1. Vault – Multi-Purpose Elementor WordPress Theme

Vault has no problem living up to its claim of being a next-generation website builder, starting with upscale selections of 50+ full websites, 1200+ templates, and 230+ premium widgets

  • Add the next-generation Theme Options Panel plus beautiful interactions and animations.
  • This theme’s interactive design tools and customization options will also impress.

The Vault framework enables you to easily create an outstanding online presence that features customer-engaging pages. 

  1. Uncode – Creative & WooCommerce WordPress Theme

This creative WordPress theme has everything you’ll need to build incredible websites and WooCommerce online stores. Uncode’s features include –

  • 70+ professionally crafted and easily importable pre-made designs you can mix and match to your heart’s desire
  • 500+ wireframes sections, an advanced Drag and Drop builder, shop layouts, and configurable Ajax product filters

Uncode’s 100,000+ sales have made it an Envato top seller. 

  1. Blocksy Free Ecommerce WordPress Theme

Blocksy is a free eCommerce WordPress theme that also gives you lightning fast performance, is completely eCommerce ready, and is absolutely loaded with intuitive website building features.

  • Blocksy’s Content Blocks features allow you to insert a piece of content anywhere throughout your site.
  • Blocksy’s Header Builder, Footer Builder, custom post types, dynamic data support, and content blocks provide all the flexibility you’re apt to need.

White Label is also offered. 

  1. Avada WordPress Theme

Avada is the #1 best selling WordPress theme of all time, which might suggest there is really nothing more to say about why it would make a good choice.

Still, checking out Avada’s website is the best way to see for yourself what this Swiss Army Knife of WordPress themes has to offer like its –

  • 400+ pre-built web pages
  • 120+ design and layout elements

And not to forget, its 750,000 happy users. 

  1. Rey WordPress WooCommerce Theme

The innovative Rey WooCommerce theme is loaded with user-friendly features and is performance oriented, developer friendly, and easy to use.

  • Rey features the popular and powerful Elementor page builder together with a useful selection of Elementor widgets that will cover almost any situation
  • Quickview, Ajax search, and smart search help site visitors find exactly what they want
  • Headers are eCommerce customized, and site visitors will love Rey’s advantageous shopping cart, wish list, and checkout features.
  1. Impeka – Creative WordPress theme

Impeka gives you complete freedom to build an engaging website that is user friendly, fast, fully responsive, and professionally optimized for SEO.

  • Impeka-built websites get noticed by the right people and give them what they want.
  • Choose Elementor, Gutenberg, or the enhanced WPBakery as your page builder.
  • Build an online shop with WooCommerce.

You can select among Impeka’s 37+ detailed demos to get a project underway.

  1. KnowAll – WordPress Knowledge Base Theme

KnowAll, the #1 knowledge base theme for WordPress, gives you a powerful tool for building an intuitive to work with knowledge base.

  • KnowAll’s advanced analytics lets you gain valuable insights into what your visitors are looking for and how they go about it.
  • KnowAll gives you a better perspective as to what content visitors find useful from the feedback they provide.
  • KnowAll can be personalized to match your company’s brand.
  1. XStore – WooCommerce WordPress Theme

XStore has provided users with an easy approach to building online stores from the get-go. An Envato favorite for the past 10 years, XStore gets projects off to a rapid start with its –

  • collection of 120+ awesome shops and multi-vendor marketplace building tools and features
  • high converting eCommerce features
  • header and single product page builders together with 60+ Elementor widgets

*******

The top WordPress themes that have been included in the above listing share a number of things in common.

Each features high quality designs, plenty of customization settings and options. Also, other useful features that have been incorporated with success in mind.

These top WordPress themes are popular for a reason. They make it easy to get the job done and get it done well. They are truly the best of the best.

No matter your choice, you will not be disappointed.

Read More at Top 12 WordPress Themes for 2023

How to Remove the Sidebar in WordPress

Do you want to remove the sidebar from your WordPress site?

The sidebar is a widget-ready area in your WordPress theme where you can show information that isn’t part of the main page content. However, sidebars can be distracting and take up valuable space.

In this article, we will show you how to easily remove the sidebar in WordPress.

How to remove the sidebar in WordPress

Why Remove the Sidebar in WordPress?

Most free and paid WordPress themes come with multiple sidebars or widget-ready areas.

You can use sidebars to show a list of your recent posts, adverts, email list signup forms, or any other content that isn’t part of the main page or post.

At WPBeginner, we use a sidebar to promote our social media pages and display our most popular posts.

An example of a WordPress sidebar

You can easily add items to a theme’s sidebar using WordPress widgets.

In most WordPress themes, the sidebar looks different depending on whether the visitor is seeing your site on a desktop or mobile device. Since smartphones and tablets have smaller screens, WordPress typically moves the sidebars to the bottom of the screen.

Depending on how your site is set up, this may look strange. Visitors will also need to scroll to the very bottom of the screen to see the sidebar content, which may affect the user experience and your conversion rates.

For more information, please see our guide on how to view the mobile version of WordPress sites from desktop.

Even on a desktop, there’s a chance that the sidebar may clash with your design or distract from the most important content, such as the page’s call to action.

With that being said, let’s see how you can remove the sidebar in WordPress. We’ll show you how to delete the sidebar from your entire site, and how to hide the sidebar on a specific page or post only.

Video Tutorial

If you don’t like the video or need more instructions, then continue reading. If you prefer to jump straight to a particular method, then you can use the links below.

Method 1. Removing Sidebars Using Your WordPress Theme Settings

Many of the best WordPress themes come with built-in settings to remove sidebars. Depending on your theme, you can remove them site-wide, or simply remove them from individual posts or pages.

The easiest way to check whether your theme has these settings is to launch the theme customizer. In your WordPress dashboard, go to Appearance » Customize.

Launching the WordPress Customizer

In the left-hand menu, look for a ‘Sidebar’ or similar setting.

In the following image, you can see the options for the popular Astra WordPress theme.

The theme settings for the Astra theme

If you do see a ‘Sidebar’ option, then click on it and then look for any settings that will remove the sidebar.

This might be a dropdown menu, thumbnails showing the different sidebar layouts, or some other setting.

Removing the sidebar using the WordPress Customizer

If your theme doesn’t have a ‘Sidebar’ option, then you may be able to remove the sidebar by selecting the ‘Page’ or similar section.

As you can see in the following image, Astra also has a ‘Page’ setting.

Changing the page layout in the WordPress customizer

Inside this setting, you’ll see different layouts including several that remove the sidebar such as ‘No sidebar’ and ‘Full Width / Stretched.’

Simply click on the different thumbnails to apply these layouts to your site.

Deleting the sidebar using the WordPress Customizer

No matter how you remove the sidebar, don’t forget to click on ‘Publish.’

Some WordPress themes also have settings that allow you to remove the sidebar from individual posts and pages. This can be useful when designing custom pages, such as a landing page.

To see whether your theme comes with these settings, simply edit any page or post where you want to hide the sidebar. In the right-hand menu, select either ‘Post’ or ‘Page’ and then look for a ‘Post Settings’ or ‘Page Settings’ option.

The page settings for the Hestia theme

If your theme has this section, then click to expand. You can now look for any settings that allow you to remove the sidebar.

In the following image, you can see the post settings for the popular ThemeIsle Hestia theme.

The Post Settings section

Keep in mind that some WordPress themes may not allow you to easily remove the sidebar using the customizer or page editor. If this is the case, then carry on reading and we’ll show you other ways to remove the sidebar in WordPress.

Method 2. Removing the Sidebar Using the Full Site Editor

If you’re using a block theme, then you can remove the sidebar using Full Site Editing (FSE) and the block editor.

This method is a quick and easy way to remove the sidebar across your entire site, although it won’t work with all themes.

To launch the editor, go to Appearance » Editor.

How to launch the FSE

You can now click to select the sidebar.

In the small toolbar that appears, click on the dotted icon.

Customize the sidebar using the full site editor

You can now delete the sidebar by clicking on the ‘Remove Column’ or similar setting.

Once you’ve done that, you can go ahead and click on the ‘Save’ button.

Removing the sidebar using the full site editor

Now, if you visit the front end of your WordPress website, you’ll see that the toolbar has disappeared.

Method 3. Removing the WordPress Sidebar Using Code

This method allows you to simply remove sidebars from every page and post on your WordPress site.

You will need to edit your theme files, so it’s not the most beginner-friendly option. However, this method should work for most WordPress themes, including themes that don’t have a built-in way to hide the sidebar.

Keep in mind that if you edit your WordPress theme files directly, then those changes will disappear when you update the theme.

With that being said, we recommend creating a child theme as this allows you to update your WordPress theme without losing customization.

First, you need to connect to your WordPress site using an FTP client such as FileZilla, or you can use the file manager of your WordPress hosting cPanel. Or if you’re a SiteGround user, your Site Tools dashboard.

If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP

Once you’re connected, go to /wp-content/themes/ and open the folder for your current WordPress theme.

The FileZilla FTP client

WordPress themes are made up of different templates, so you will need to edit all the templates that include a sidebar. To work out what files you need to edit, see our guide to WordPress template hierarchy.

For example, you may need to edit index.php, page.php, single.php, archive.php, home.php, and so on.

To edit a file, open it in a text editor such as Notepad. Then, find the line that looks like this:

<pre class="wp-block-syntaxhighlighter-code">
<?php get_sidebar(); ?>
</pre>

If your theme has multiple sidebars, then the code will look slightly different and there may be multiple pieces of sidebar code. Typically, this code will have a sidebar name inside the function, for example:

<pre class="wp-block-syntaxhighlighter-code">
<?php get_sidebar('footer-widget-area'); ?>
</pre>

You can simply delete the line for the sidebar that you want to remove.

Now, save and upload the file back to your WordPress hosting account. Simply repeat the process described above for all the template files that include a sidebar.

When you’re finished, you can visit your WordPress blog to see the change in action.

You may notice that although the sidebars are gone, your content area is still the same width, which leaves the sidebar area empty.

An empty space where the sidebar should be

This happens when the theme has a defined width for the content area. After removing the sidebar, you need to adjust the width of the content area by adding custom CSS to your WordPress theme.

To do this, go to Theme » Customize. In the left-hand menu, click on Additional CSS.

Adding CSS with the WordPress customizer

You can now go ahead and paste the following code into the little code editor:

<pre class="wp-block-syntaxhighlighter-code">
.content-area {
    width: 100%;
    margin: 0px;
    border: 0px;
    padding: 0px;
}

.content-area .site {
margin:0px;
}
</pre>

Don’t forget to click on the ‘Publish’ button. Now, if you visit your site you’ll see that the content area now takes up 100% of the available space.

Method 4. Removing Sidebars From Individual Pages in WordPress

You may only want to remove the sidebar on certain pages while showing the sidebar on other areas of your site. For example, many websites don’t show the sidebar on their sales pages, as this can distract from the page’s call to action.

If you just want to remove the sidebar from a specific page, then we recommend using a page builder plugin like SeedProd.

SeedProd lets you design any kind of page using a simple drag-and-drop editor. This makes it easy to add and remove the sidebar from any page.

In the SeedProd editor, simply click to select the sidebar you want to remove. Then, go ahead and click on the trash can icon.

Removing a sidebar using SeedProd

If you want to remove the sidebar from your entire site, then you can also use SeedProd to easily create a custom theme that doesn’t have any sidebars.

Method 5. Removing Sidebars from a Static Page in WordPress

Some WordPress themes come with multiple templates, including full-width page templates that don’t show the sidebar on either side of the content. You can use these templates to remove the sidebar from any page.

To see whether your theme has a full-width template, simply open any page. In the right-hand menu, select the ‘Page’ tab and look for a ‘Template’ section.

Changing the WordPress page template

If you find this section, then click on it to see all the options available.

You can now open the dropdown menu and look for a full-width template.

How to remove the sidebar with a full width template

If your theme doesn’t have a full-width template, then you can create one manually.

Open a plain text editor like Notepad and paste the following code in a blank file:

<pre class="wp-block-syntaxhighlighter-code">
<?php
/*
*
Template Name: Full-Width
*/
get_header(); ?>
</pre>

You can now save this file with the name full-width.php.

After that, connect to your site using an FTP client or the file manager supplied by your WordPress hosting provider.

Then, go to /wp-content/themes/ and open the folder for your current theme. Inside this folder, find the page.php file and open it in any text editor.

The FileZilla FTP client

Now, copy everything that appears after the <?php get_header(); ?> line and paste it into your full-width.php file.

Once you’ve done that, find and delete the line that looks like this:

<pre class="wp-block-syntaxhighlighter-code">
<?php get_sidebar(); ?>
</pre>

You can now save your changes and upload the full-width.php file to your theme folder.

You can now use this template with any page. Simply open the ‘Template’ dropdown in the right-hand menu and select your full-width template.

A full-width template

Note: If you have a page open in the content editor while creating the full-width.php file, you will have to refresh the editor for the new template to appear in the dropdown menu.

For more details, see our guide on how to create a full width page template in WordPress.

Method 6. Remove the Sidebar from a Single Post in WordPress

Just like pages, WordPress also comes with built-in support for post templates.

If you want to remove the sidebar from certain single posts, then you can create a custom single-post template. It is similar to creating a full-width page template.

First, you’ll need to create a new template file using a text editor like Notepad. Once you’ve done that, you can copy and paste the following code in that file:

<pre class="wp-block-syntaxhighlighter-code">
<?php
/*
 * Template Name: Featured Article
 * Template Post Type: post, page, product
 */

 get_header();  ?>
</pre>

This code creates a new template called ‘Featured Article’ and makes it available for any page or post, plus any product post types in your online store.

In your custom single post template, you simply need to remove the sidebar part of the code. For more information, you can follow the steps outlined in our guide on how to create custom single post templates in WordPress.

When you’re done, save this file as full-width.php.

Next, you need to upload the file to your current WordPress theme folder using an FTP client or file manager.

Once you’ve done that, you can apply this template to any post. In the right-hand menu, simply click to expand the ‘Templates’ section and then select the full-width template.

How to create a full-width template in WordPress

We hope this article helped you learn how to easily remove the sidebar in your WordPress theme. You may also want to see our step-by-step guide on how to boost WordPress speed and performance, and our comparison of the best email marketing services to grow your traffic & sales.

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.

The post How to Remove the Sidebar in WordPress first appeared on WPBeginner.