Categories
Woo Tricks

Resolved Woocommerce product as Homepage

Woocommerce product as Homepage This is generally required for Ad campaigns and product deal of the day sales, or for sites having a single product or service to highlight the page.

Table of Contents

Display Single Product Page to a WooCommerce Home Page

Woocommerce product as Homepage
From Appearance > Settings you can change your home page
This Screenshot Shows the ID of the Product here 26 is the ID

Short Codes

You can Display products on a Home Page with the short codes of the Product ID, Simply like

[product_page id="1234"]

Please change your product id with whatever you wish to display.

If this doesn’t displays, to solve this you can remove the <pre> Tags from the Short Code, Explained here with the Official documentation.

Here is the link if you want to explore Shortcodes included with WooCommerce

Code in your Template

<?php echo do_shortcode('[product_page id="1234"]'); ?>

This Code goes between your header and footer code of the page template for the home page.

Manually with an image and cart shortcode

You can display the same with the image selected from block editor and then below that using the cart short-code

The Result is like this

By Rahul Kharbanda

Hi,
I am Rahul Kharbanda from India. I hope you like all the content I made. Welcome to comment & connect.
I am on Quora , Github , Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *