Displaying WooCommerce Archive Products on Another Page: A Beginner’s Guide
Want to show your WooCommerce products on a page other than the default shop page? Maybe you want a dedicated “Featured Products” page or a specific category page outside the standard WooCommerce archive structure. This guide will show you how, even if you’re a complete newbie to coding.
Why Display WooCommerce Products Elsewhere?
There are many reasons why you might want to showcase your products outside the standard WooCommerce shop page. Consider these examples:
- Improved Site Organization: A large online store with many product categories might benefit from separate pages for featured items or bestsellers to improve user experience and navigation. Imagine a massive furniture store – a page solely dedicated to “Modern Sofas” would be much more user-friendly than forcing customers to navigate multiple category levels.
- Targeted Marketing Campaigns: You could create landing pages for specific promotions, displaying only products relevant to that campaign. For example, a “Summer Sale” page showing only discounted summer clothing.
- Custom Layouts and Designs: You might want a completely different design or layout for a specific product selection than what your standard shop page uses.
Methods to Display WooCommerce Archive Products on a New Page
There are a couple of ways to achieve this, ranging from simple plugins to custom code. Let’s explore the most common approaches:
#### 1. Using a Plugin (The Easiest Method)
The simplest way is using a WooCommerce plugin. Several plugins offer this functionality, allowing you to easily create custom product displays without touching any code. Search the WordPress plugin repository for terms like “WooCommerce custom product display” or “WooCommerce product shortcodes.”
Benefits: No coding required, usually user-friendly interfaces.
Drawbacks: You’re reliant on a third-party plugin; some might have limitations or not be regularly updated.
#### 2. Using a Shortcode (Intermediate)
Many WooCommerce plugins provide shortcodes that you can use within a page or post. These shortcodes act as snippets of code that display specific product categories, tags, or even individual products. For instance, a shortcode like `[products category=”summer-sale”]` might display all products in the “Summer Sale” category.
Benefits: Relatively simple to implement if the plugin provides the required shortcode.
Drawbacks: Still requires a plugin, limited flexibility compared to custom code.
#### 3. Using Custom Code (Advanced)
If you need maximum control and flexibility, you’ll need to use custom code. This involves adding code to your theme’s `functions.php` file or a custom plugin. This approach is more technically demanding but provides the most flexibility.
Example: Displaying a specific product category
This code snippet shows how to display products from a specific category (‘summer-sale’) using the `woocommerce_archive_description` hook:
slug) ? $current_category->slug : null;
// Only show products if it’s the ‘summer-sale’ category
if ($category_slug === ‘summer-sale’){
woocommerce_product_loop_start();
woocommerce_product_subcategories(); //Show subcategories if needed
woocommerce_product_loop_end();
}
}
?>
Important Note: Always back up your website before adding any custom code. If you’re not comfortable with coding, hire a developer to help you.
Choosing the Right Method
The best method depends on your technical skills and the level of customization needed.
- Beginners: Start with a plugin. It’s the easiest and safest way to get started.
- Intermediate Users: Shortcodes offer more control than plugins but still require some technical understanding.
- Advanced Users: Custom code provides ultimate flexibility but requires coding expertise and carries a higher risk of errors if not done correctly.
Remember to thoroughly test your changes after implementation to ensure everything displays correctly and functions as expected. By following these steps, you can successfully display your WooCommerce archive products on any page you choose, enhancing your website’s functionality and user experience.