You can add many fields in the billing and shipping form by following snippets but what if we want to add fields outside it on the checkout form so to do that follow this code. In the below image check the default fields provided. Now let’s add the field to the form. Add the following
Is it possible to arrange the checkout in 2 columns? Yes, here is the simple snippet which helps to add 2 columns. This is useful when you want to shorten some fields in the billing form. So let’s give it a try. Please practice this code in your child theme style.css file
Give alerts or important notes to your users by adding custom messages when they visit your shop page to help them out. Here we are going to add a custom message for the subscriber role which you can change with your desired role. In the below image there is no such message present. Now let’s
Some Templates hide the product review statics from the shop page. To display the review in brief on the product page here is the snippet that can be used. In the below image you can see there is no such star rating. Now let’s add the star rating to the products. Add the following snippet
This is a bit cunning snippet. However, if you want to showcase your favorite posts without any plugin installation then this is the best way to do so. Just follow this snippet.Paste the following to the function.php file in your child theme. In this function we are first, checking if the existing is a single
If you wish to show post thumbnail image in your RSS feed instead of text content. Then here is the useful snippet function. It will add the post feature thumbnail before your content.Add the following function to the function.php file in your child theme. Here in the above function, we are checking the post feature
Do you want to set a fallback featured image?If yes then here is the snippet for it. It is helpful when you do not have any featured image in your post, you can display your desired image or your company logo as your post featured image. First, upload the image to your theme image folder.
Not everyone who logs into the site backend needs access to every available admin menu items.It can cause several problems for a person who does not understand. To reduce such cases add the snippet to your function.php file in your child theme. In the above function first, we are checking the current user role. However,
The WordPress admin bar provides several links such as adding new posts, pages, etc. However, if you want to remove such options, here is the solution for it. Paste the following to the function.php in your child theme. Here we are simply using add_filter to remove the admin bar by returning false.
The Search feature of WordPress is around for a long time. However, if you do not want your users to search through your site for some reason, then this snippet will be helpful. It not just removes the search bar in your sidebar menu but removes the entire concept of WP search. This can be