How to remove Woocommerce sidebar from front-page using hooks

Woocommerce is one of the most popular plugins for WordPress because it’s used by anyone wants to setup online shop without the need writing a single line of code.
Themes are one of the notable features that come with Woocommerce out of box. It comes with a default theme as well as you can download many out from WordPress.org theme repository and many theme stores online. In fact most of those themes on the WordPress repository and theme stores are fully compatible with WordPress.
Therefore this post is targeting people with custom themes made by themselves or got from somewhere but haven’t come with Woocommerce support.
Let’s start right away!
Go to Appearance -> Edit after logging in to the WordPress Dashboard where Woocommerce is installed.
Look for the functions.php file. For experienced WordPress coders you can create your own site specific plugin. This is where you can add custom code.
Let’s remove a Woocommerce sidebar action.
Use the code below in your themes functions.php or site specific plugin.
<?php
remove_action( ‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’, 10 );
Save and reload the front-end of your shop page.
As simple as that.
 
 
 

Sharing is caring

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp
Share on email
Email

You may also like this

When not to use a forEach loop in JavaScript

A forEach loop is one of the most optimized JavaScript Higher-Order functions that make it one of the preferred functional programming languages. What is a Higher-Order function? It is a function which takes in another function (also called a callback)

Read More »
Thoughts

You are not about to die poor.

In recent years, the biggest number of people I have met are characterized by the following;- Lazy Not ready Entitled Ignorant Dishonest Inconsistent It sounds unfortunate, that most probably you will meet people of similar characteristics or more if you’ve

Read More »
Thoughts

Thoughts on 13-06-2019

I promised to share my thoughts in any possible way. In fact, am happy to be honoring you, my readers, that today by sharing something that could be life changing to some. Please, I request you to converse through the

Read More »
Thoughts

A beautiful thought for 29-05-2019

Hey beloved, Once in a while, I develop thoughts in my head, and instead of keeping them to myself I’ve decided to share them. Who knows who it will help? By the way, at the bottom of the post, is

Read More »