Monday, March 29, 2021

How to Add Subscriptions to WooCommerce (Free Alternative)

Do you want to add subscriptions to WooCommerce in WordPress?

Adding subscriptions lets you offer memberships, create premium content, and generate consistent revenue for your business.

In this article, we’ll show you how to easily add recurring subscriptions to WooCommerce using multiple methods.

How to add subscriptions to WooCommerce (free alternative)

Why Add Subscriptions to WooCommerce?

There are many benefits to adding WooCommerce subscriptions to your WordPress site.

First, it helps to automate the billing process and saves you a lot of time. You don’t have to manually invoice your customers every single month.

By adding subscription payments to your ecommerce business, you’ll have more consistent cash flow, fewer payment errors, and less payment delays.

It also gives you more flexibility in the type of ecommerce site you can create.

  • A recurring physical product subscription like Dollar Shave Club
  • A members only online store, like a virtual version of Costco
  • A curated membership box like Stitch Fix

That being said, let’s take a look at how to add subscriptions to WooCommerce.

We’ll cover multiple ways to add subscriptions to WooCommerce, and you can choose the one that works best for your business.

Method 1. Add WooCommerce Subscriptions (Paid Option)

This method is easier and recommended for most WooCommerce store owners.

For this, we’ll be using the official WooCommerce Subscriptions extension.

WooCommerce subscriptions extension

This extension is built by the team behind WooCommerce. It allows you to create and manage subscription products and create recurring payments.

You’ll be able to do things like create subscriptions for digital and physical products, create monthly subscription boxes, yearly software packages, and more.

The easiest way to get started with WooCommerce Subscriptions is to sign up for Bluehost WooCommerce hosting.

Bluehost has agreed to offer an exclusive discount for our readers that also includes the $199 WooCommerce subscription extension for free.

→ Click Here to Claim This Exclusive Bluehost Offer ←

Aside from free WooCommerce subscriptions, this Bluehost plan also comes with close to $1000 worth of premium extensions for free including Online Bookings & Appointments, Jetpack Premium, and more.

This is why they’re among the top WooCommerce hosting providers in our list.

Once you sign up for hosting, both WooCommerce and the WooCommerce Subscriptions extension will be automatically installed.

After that, you can easily add subscriptions to any WooCommerce products in to your online store.

You’ll have an option in your WooCommerce product editing page where you can set your subscription settings.

WooCommerce subscription options

For more help with WooCommerce, see our ultimate WooCommerce tutorial.

Method 2. Add WooCommerce Subscriptions (with a Free Plugin)

This method is for store owners on a budget who want to add subscriptions to WooCommerce for free.

To do this, we’ll use the YITH WooCommerce Subscription plugin. This free plugin lets you simply add subscriptions for simple, digital, or downloadable products.

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

After the plugin is installed and activated, you’ll have a new menu item called ‘YITH’ in your WordPress dashboard.

Navigate to YITH » Subscriptions and select ‘Settings’ and make sure the ‘Enable Subscription’ box is set to ‘Yes.’

Enable YITH WooCommerce subscription setting

Next, open a product you want to turn into a subscription by navigating to Products » All Products.

Then, select your subscription product.

Select WooCommerce product for subscription

After that, go to the ‘Product data’ box and check the ‘Subscription’ check box.

This will add a new option where you can set the subscription price and maximum length of the subscription.

Set product subscription price with YITH

Once you’ve added your subscription settings, make sure you save your product by clicking the ‘Update’ button.

Now, when your visitors purchase a product, they’ll have the subscription payment option.

Subscription product example

Method 3. Add WooCommerce Subscriptions for Memberships and Courses

Are you creating a membership site or selling online courses and want to set up subscription payments for your visitors?

This is where MemberPress comes in. It’s the best WordPress membership plugin in the market.

You can sell subscriptions, online courses, premium content, and digital downloads with this plugin.

MemberPress membership page

To add membership subscriptions, first, you’ll need to create your membership website. To get started, see our step by step guide on creating a WordPress membership site.

After that, you can add recurring subscription memberships with MemberPress.

To do this, see our step by step guide on how to accept recurring payments in WordPress.

Once you’ve set up subscription memberships, you can assign your WooCommerce products to your memberships.

This allows you to hide specific products and make users sign up for a membership to view your products or make a purchase.

To do this, navigate to MemberPress » Rules and click ‘Add New’.

MemberPress rule settings

Next, under the ‘Rule Options’ setting, select ‘All Products’ from the drop down list.

Then, select the membership level you want to give access to the products. In this case, we’re only giving our ‘Monthly Subscription’ members access to the products in our store.

Configure membership rule

Once you’ve made these changes make sure to save your changes by clicking ‘Save Rule’.

You can also use MemberPress as full LMS plugin to create courses. Aside from membership, MemberPress is also the best WordPress LMS plugin in the market.

It lets you simply create online courses with an immersive learning experience. With their course addon, you can drip feed content, add engagement triggers to keep your students active, all with an easy to use drag and drop builder.

Add course sections in MemberPress

The courses feature work seamlessly with any WordPress theme, and their class room mode feature is our favorite because it offers a distraction free learning experience.

The MemberPress course curriculum that users see, showing their progression through the course

Once your customers sign up for a membership level in MemberPress, they’ll be automatically enrolled in your courses. You can even bundle your courses together for a discount and sell course access as a recurring subscription.

We hoped this article helped you add subscriptions to WooCommerce. You may also want to see our list of the best WooCommerce plugins for your store and our ultimate guide on WooCommerce SEO.

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 Add Subscriptions to WooCommerce (Free Alternative) appeared first on WPBeginner.


March 29, 2021 at 03:30PM

Friday, March 26, 2021

6 Best Video Editing Software of 2021 Compared (Easy & Powerful)

Are you looking for the best video editing software?

Video editing software lets you create professional videos for your WordPress site, Instagram, YouTube, and other social media channels.

In this article, we’ve hand-picked some of the best video editing software that you can use to easily create videos. We have used these tools to create YouTube videos that have gotten over 500 million views.

Best video editing software compared

Why is Choosing the Best Video Editing Software Important?

It’s no secret that video content is taking over the world.

We all use streaming services like Netflix, video-focused social media networks like TikTok, IGTV, and Snapchat. Plus, there’s YouTube, the second largest search engine in the world.

The right video editing software can help you in a lot of ways:

Picking the right video editing software and learning the tool’s ins and outs can transform your WordPress website and online presence.

You can use it to create professional quality videos for your YouTube channel, Facebook ads, Instagram profile, and more.

Over the last 10 years, we have tried all the popular video software in our quest to grow our YouTube channels. The WPBeginner channel has over 233,000 subscribers on YouTube.

We had another channel that we grew to 2.5 million subscribers and 500 million subscribers before selling it in 2018.

While we’re not video pros, we have learnt a few things over the years.

Here are the most important things you’ll need to consider when choosing the best video editing software:

  • The type of videos you’re going to create
  • The kind of computer you’re using (Apple or Windows)
  • The video file types you’re going to be editing
  • The transitions and effects you want to apply
  • Your existing skillset with video editing

Having said that, let’s take a look at some of the best video editing software in the market today.

1. Adobe Premiere Pro

Adobe Premiere Pro

Adobe Premiere Pro is the best all-around video editing software. It’s the industry standard for professionals in Hollywood, television, and is even used by popular YouTubers.

It’s cross platform compatible and works on both Mac and Windows.

If you’re already an Adobe user and are using other products like, Photoshop, After Effects, or Adobe Stock, then it makes sense to use Premiere Pro since it integrates with the other products seamlessly.

It supports the latest 4K, 8K, and VR video formats and can handle multi-angle shots. It also has advanced trimming and editing tools to give you high levels of control.

There are robust color grading, color correction, and compositing features. Plus, there’s chroma key options to remove backgrounds for green screen videos.

You can import from virtually any source or format, and you have an unlimited number of video tracks to flex your creativity.

You’ll even find automated tools with the Adobe Sensei technology, which works to help speed up the editing process.

Finally, there are a ton of exporting options. You can easily export directly to YouTube, Vimeo, and more.

Note: If you want a more affordable and beginner-friendly tool, then Adobe Premiere Elements is a great choice.

Beyond the video editing tools, there’s a wealth of audio editing tools as well. The sound panel comes equipped with features and effects like reverb, compression, amplification, stereo balance, and more.

You can subscribe to Adobe Premiere Pro by itself for $239.88 per year. Or you can purchase the entire Creative Cloud suite ($52.99 per month) which gives you access to all 20+ Adobe apps including Premiere Pro, Photoshop, Illustrator, XD, all Adobe Pro fonts, and collaboration tools.

The creative suite is great value and that’s what we use for our business.

Expert Review: We believe Adobe Premiere Pro is best overall video editing software.

2. Camtasia

Camtasia

Camtasia is primarily known for its screen recording features, but you’ll also find powerful video editing functionality.

The combination of screen recording and editing tools makes it perfect for creating YouTube tutorials, online course lessons, how-to videos, product reviews, and more.

You’ll find a library of video templates you can use to easily create the exact kind of video that you want.

The process for editing videos is very straightforward. Just use the drag and drop editor to edit your video and add animations and transition effects quickly.

There’s also an integration with PowerPoint to help you create captivating presentations and tutorials. You’ll even find cool interactive features like quizzes that you can add to your videos.

You can use the iPhone app to record videos on your phone and edit them using the software. This is great if you’re creating mobile tutorial videos or walkthroughs.

Camtasia offers an individual plan for $249.99, which gives you access to all features and is compatible with both Windows and Mac.

Larger teams can purchase the business license, and there are both education, government, and non-profit discounts available.

Expert Review: We believe Camtasia is best video editing software for online course creators and how-to video editors.

Several of our team members use Camtasia to create screencast tutorial videos for our products.

3. Promo

Promo

Promo is a great online video editor perfect for making marketing videos. It’s incredibly easy to use. Even if you’re not tech-savvy, you can put together promotional content quickly and simply.

If you get stuck when coming up with Instagram video ideas or video ads for Facebook and YouTube, then this tool is for you.

It only takes a couple of clicks to create an engaging video ready to post online. It’s super easy.

All you have to do is choose your campaign type or industry, select from one of 5 million templates, then add customizable animations, video clips, and text. You can even see your changes in real-time.

You’ll find templates in industries like business, real estate, marketing, travel, ecommerce, and recruiting and HR.

Plus, specialized templates for marketing tasks like promo videos, Facebook ads, Instagram ads, YouTube Ads, and LinkedIn ads.

For those who want more creative control, you can start from scratch with a blank template.

The Basic plan starts at $49 per month.

If you create a lot of marketing videos, then the Standard plan gives you access to unlimited premium clips and video downloads, plus you can add watermark to your videos for $99 per month.

The premium plans also give you access to an iOS or Android mobile app, which lets you create videos on the go.

Expert Review: We believe Promo is the best video editor for creating and editing marketing videos. It’s great for business owners, marketers, and non-techy users.

4. Wondershare Filmora

Filmora by Wondershare

Filmora by Wondershare is a very simple and easy to use video editing software. It has a short learning curve, so it’s perfect for those just getting started with video editing.

Even if you’ve never used a video editing software before, you can use this intuitive and easy to navigate editor to create your first video.

As your skills improve, you can take advantage of the advanced editing features this tool offers such as noise removal, speed control, color tuning, and more.

You’ll also find a library of visual effects and built-in titles that are designed with YouTubers in mind. There’s also a library of royalty-free music and sound effects you can use in your videos.

The most recent release added features like motion graphics, color matching, and a keyboard shortcuts editor to help you create your own time saving workflows.

There’s also a free mobile app for editing videos on the go, and simply uploading to Instagram or YouTube.

The premium version costs $69.99 for a lifetime payment, or you can choose to pay $44.99 per year.

There is a free version available, which has all the same features as the paid version. But, your videos will have their company watermark present.

If you want unlimited downloads from the stock film library, then there’s a Bundle plan for $104.87 per year.

Expert Review: We believe Wondershare Filmora is the best beginner-friendly video editing software.

5. Final Cut Pro

Final Cut Pro

Final Cut Pro is the best video editing software for macOS used by over 2 million people. This tool is very easy to use, despite being so powerful.

Final Cut Pro and Adobe Premiere Pro offer a nearly identical set of features. The big difference is Final Cut Pro X isn’t Windows compatible.

It’s equipped with advanced functionality to help you edit videos faster like, Smart Conform cropping, which will ensure that no essential scenes get cut.

There are grouping tools, organization features, animation templates, transitions, and a library of video effects. Plus, built-in audio editing features.

If you’re going to post videos to Facebook or YouTube, then you can use the export feature to automatically optimize and set the right aspect ratio for these platforms.

Since Final Cut Pro isn’t subscription-based, it offers you a simpler pricing model. Pay a one time fee of $299.99 and access the software forever.

Expert Review: We believe Final Cut Pro is the best video editing program for Mac users.

6. CyberLink PowerDirector 365

CyberLink PowerDirector 365

CyberLink PowerDirector 365 is feature-rich high-end video editing software. However, it doesn’t carry the high price tag of tools with a similar set of features.

You’ll find functionality like a 100-track timeline, video correction tools, motion tracking, support for multi-cam editing, and stabilization features (great for GoPro footage).

It also has support for 360-degree video editing and nearly all file formats and file types.

Beyond the standard professional video editing features, there are additional features and pre-made templates for creating slideshows, DVD menus, and even screen recording.

Now, the tool isn’t the most intuitive for beginners. However, there is a massive video tutorial library to help you use the software.

This software starts at $19.99 per month, or you can pay $51.99 for the year, which is $4.33 monthly.

Expert Review: We believe CyberLink PowerDirector 365 is the best for users who need advanced features, but have a small budget.

Which is the Best Video Editing Software for You?

After carefully researching and testing the top video editing software, we believe that Adobe Premiere Pro is the best video editing software in the market.

It’s the industry leading software used for everything from Hollywood productions to YouTube videos and everything in-between.

It has every feature you could want and plenty of tutorials for beginners who are just getting started using the software.

If you’re looking for creating guided video tutorials (screencasts + video), then Camtasia is the best cross-platform video editing software for screen recording.

If you’re looking for an easy tool for creating promo videos for social media ads or marketing campaigns, then Promo.com comes with a lot of templates. It’s made for marketers & non-techies.

Aside from the top video editing software in our list, we also looked at other video editing software like Corel VideoStudio, DaVinci Resolve, Pinnacle Studio, Lightworks, VSDC, Shotcut, and HitFilm Express.

However, we decided not to list them to help make your decision easy and avoid choice paralysis.

Best Video Editing Software FAQs

Having helped thousands of users find the best video editing software for their needs, we’ve answered a lot of questions.

Below are some of the most common questions we’ve received about video editing software providers.

What is the best free video editing app?

The best free video editing app is the iMovie movie maker. The free software comes preinstalled on most Mac machines.

It’s beginner-friendly and has plenty of special effects to enhance your videos. It also works on iPads.

If you’re not using macOS, then Wondershare Filmora has a great free video editing app. It’s packed with advanced features and a beginner learning curve.

What’s the best video editing software for beginners?

The best video editing software for beginners is Filmora. It’s intuitive, easy to use, and comes with filters, overlays, transitions, motion elements, and more.

It also has a mode called “Easy Mode” that lets you create simple edits by choosing a theme and dragging and dropping clips and presets.

Adobe Premiere Element is also pretty beginner friendly.

If you’re looking to create promo videos, then Promo.com is the easiest video editing software for non-techies & marketers.

What do most YouTubers use to edit their videos?

Most YouTubers use popular video editing software like Final Cut Pro, Adobe Premiere Pro, and iMovie. However, most video editing tools have similar features overall.

If you’re starting a YouTube channel, then the best video editing software is one that you can use and fits within your budget. As your channel grows, you can improve your skills and invest in professional video editing software.

We hoped this article helped you find the best video editing software to use with your WordPress site. You may also want to see our expert list of the best webinar software and best online course platforms to create & sell online courses.

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 6 Best Video Editing Software of 2021 Compared (Easy & Powerful) appeared first on WPBeginner.


March 26, 2021 at 05:00PM

Thursday, March 25, 2021

WordPress Body Class 101: Tips and Tricks for Theme Designers

Are you an aspiring WordPress theme designer looking for new ways to use CSS into your themes?

Luckily, WordPress automatically adds CSS classes that you can utilize in your themes. Several of these CSS classes are automatically added to the <body> section of every page on a WordPress site.

In this article, we will explain the WordPress body class with tips and tricks for aspiring theme designers to utilize them in their projects.

Using WordPress body class for theme development
Here is a quick overview of what you’ll learn in this article.

What is WordPress Body Class?

Body class (body_class) is a WordPress function that allows you to assign CSS classes to the body element.

The HTML body tag normally begins in a theme’s header.php file, which loads on every page. This allows you to dynamically figure out which page a user is viewing and then add the CSS classes accordingly.

Normally most starter themes and frameworks already include the body class function inside the HTML body tag. However, if your theme does not have it, then you can add it by modifying the body tag like this:

<body <?php body_class($class); ?>>

Depending on the type of page being displayed, WordPress automatically adds the appropriate classes.

For example, if you are on an archive page, WordPress will automatically add archive class to the body element. It does that for just about every page.

Related: See how WordPress works behind the scenes (infographic)

Here are some examples of common classes that WordPress might add, depending on which page is being displayed:

.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}
.paged {}
.attachment {}
.error404 {}
.single postid-(id) {}
.attachmentid-(id) {}
.attachment-(mime-type) {}
.author {}
.author-(user_nicename) {}
.category {}
.category-(slug) {}
.tag {}
.tag-(slug) {}
.page-parent {}
.page-child parent-pageid-(id) {}
.page-template page-template-(template file name) {}
.search-results {}
.search-no-results {}
.logged-in {}
.paged-(page number) {}
.single-paged-(page number) {}
.page-paged-(page number) {}
.category-paged-(page number) {}
.tag-paged-(page number) {}
.date-paged-(page number) {}
.author-paged-(page number) {}
.search-paged-(page number) {}

As you can see, by having such a powerful resource at hand, you can entirely customize your WordPress page by using just CSS. You can customize specific author profile pages, date-based archives, etc.

That being said, now let’s take a look at how and when would you use the body class.

When to use The WordPress Body Class

First, you need to make sure that your theme’s body element contains the body class function as shown above. If it does, then it will automatically include all the WordPress generated CSS classes mentioned above.

After that, you will also be able to add your own custom CSS classes to the body element. You can add these classes whenever you need them.

For example, if you want to change the appearance of articles by a specific author filed under a specific category.

How to Add Custom Body Classes

WordPress has a filter that you can utilize to add custom body classes when needed. We will show you how to add a body class using the filter before showing you the specific use case scenario just so everyone can be on the same page.

Because body classes are theme specific, you would need to add the following code to your theme’s functions.php file.

function my_class_names($classes) {
        // add 'class-name' to the $classes array
        $classes[] = 'wpb-class';
        // return the $classes array
        return $classes;
}

//Now add test class to the filter
add_filter('body_class','my_class_names');

The above code will add a class “wpb-class” to the body tag on every page on your website. That’s not so bad, right?

Now you can utilize this CSS class in your theme’s stylesheet directly. If you are working on your own website, then you can also add the CSS using the custom CSS feature in theme customizer.

Adding custom CSS in theme customizer

Adding Body Class Using a WordPress Plugin

If you are not working on a client project and don’t want to write code, then this method would be easier for you.

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

Upon activation, you need to visit Settings » Custom Body Class page. From here you can configure plugin settings.

Custom Body Class settings

You can select post types where you want to enable body class feature and who can access it. Don’t forget to click on the save changes button to store your settings.

Next, you can head over to edit any post or page on your WordPress site. On the post edit screen, you will find a new meta box in the right column labeled ‘Post Classes’.

Adding body classes to a post in WordPress

Click to add your custom CSS classes. You can add multiple classes separated by a space.

Once you are done, you can simply save or publish your post. The plugin will now add your custom CSS classes to the body class for that particular post or page.

Using Conditional Tags with The Body Class

The real power of the body_class function comes when it is used with the conditional tags.

These conditional tags are true or false data types that check if a condition is true or false in WordPress. For example, the conditional tag is_home checks if the page currently displayed is the homepage or not.

This allows theme developers to check if a condition is true or false before adding a custom CSS class to the body_class function.

Let’s take a look at some examples of using conditional tags to add custom classes to the body class.

Let’s say you want to style your homepage differently for logged in users with the author user role. While WordPress automatically generates a .home and .logged-in class, it does not detect the user role or add it as a class.

Now, this is a scenario where you can use the conditional tags with some custom code to dynamically add a custom class to the body class.

To achieve this you will add the following code to your theme’s functions.php file.

function wpb_loggedin_user_role_class($classes) { 

// let's check if it is homepage
if ( is_home() ) {

// Now let's check if the logged in user has author user role.  
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
    //The user has the "author" role
    // Add user role to the body class
    $classes[] = 'author';
    // Return the classes array
    return $classes;      
} 
} else { 
// if it is not homepage, then just return default classes
return $classes; 
}
} 

add_filter('body_class', 'wpb_loggedin_user_role_class');

Now, let’s take a look at another useful example. This time we are going to check if the page displayed is a preview of a WordPress draft.

To do that we will use the conditional tag is_preview and then add our custom CSS class.

function add_preview_class($classes) { 
if ( is_preview() )  {
$classes[] = 'preview-mode';
return $classes;
}
return $classes; 
}
add_filter('body_class','add_preview_class');

Now, we will add the following CSS to our theme’s stylesheet to utilize the new custom CSS class we just added.

.preview-mode .site-header:before { 
content:'preview mode';
color:#FFF;
background-color:#ff0000;
}

This is how it looked on our demo site:

Custom preview mode CSS class added to the body class

You may want to check out the full list of conditional tags that you can use in WordPress. This will give you a handy set of ready to use tags for your code.

Other Examples of Dynamically Adding Custom Body Classes

Apart from conditional tags, you can also use other techniques to fetch information from the WordPress database and create custom CSS classes for the body class.

Adding category names to the body class of a single post page

Let’s say you want to customize the appearance of single posts based on the category they are filed in. You can use the body class to achieve this

First, you need to add category names as CSS class on single post pages. To do that, add the following code to your theme’s functions.php file:

// add category nicenames in body class
function category_id_class($classes) {
    global $post;
    foreach((get_the_category($post->ID)) as $category)
        $classes[] = $category->category_nicename;
    return $classes;
}
 
add_filter('body_class', 'category_id_class');

The code above will add the category class in your body class for single post pages. You can then use CSS classes to style it as you wish.

Adding page slug to the body class

Paste the following code in your theme’s functions.php file:

//Page Slug Body Class
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'add_slug_body_class' );

Browser Detection and Browser Specific Body Classes

Sometimes you may come across issues where your theme may need additional CSS for a particular browser.

Now the good news is that WordPress automatically detects browser upon loading and then temporary stores this information as a global variable.

You just need to check if WordPress detected a specific browser and then add it as a custom CSS class.

Simply, copy and paste the following code in your theme’s functions.php file:


function wpb_browser_body_class($classes) { 
        global $is_iphone, $is_chrome, $is_safari, $is_NS4, $is_opera, $is_macIE, $is_winIE, $is_gecko, $is_lynx, $is_IE, $is_edge;

if ($is_iphone)    $classes[] ='iphone-safari';
elseif ($is_chrome)    $classes[] ='google-chrome';
elseif ($is_safari)    $classes[] ='safari';
elseif ($is_NS4)    $classes[] ='netscape';
elseif ($is_opera)    $classes[] ='opera';
elseif ($is_macIE)    $classes[] ='mac-ie';
elseif ($is_winIE)    $classes[] ='windows-ie';
elseif ($is_gecko)    $classes[] ='firefox';
elseif ($is_lynx)    $classes[] ='lynx';
elseif ($is_IE)      $classes[] ='internet-explorer';
elseif ($is_edge)    $classes[] ='ms-edge';
else $classes[] = 'unknown';
        
return $classes;
}
add_filter('body_class','wpb_browser_body_class');

You can then use classes like:

.ms-edge .navigation {some item goes here}

If it is a small padding or margin issue, then this is a fairly easy way of fixing it.

There are definitely many more scenarios where using the body_class function can save you from writing lengthy lines of code. For example, if you are using a theme framework like Genesis, then you can use it to add custom classes in your child theme.

You can use the body_class function to add CSS classes for full-width page layouts, sidebar content, header and footers, etc.

We hope this article helped you learn how to use the WordPress body class in your themes. You may also want to see our article on how to style each WordPress post differently, and our comparison of 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 WordPress Body Class 101: Tips and Tricks for Theme Designers appeared first on WPBeginner.


March 25, 2021 at 03:06PM