Minimum theme files required for WooCommerce to function properly?
- This topic is empty.
-
AuthorPosts
-
BillyGuest
What is the fastest way to support WooCommerce in a WP theme I’m developing, will it just use the index.php if no Woo templates exist?
StephanieGuestTechnically you can get away with only adding a snippet to
functions.php
if you want that defines your main content wrapper:remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
Then:
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10); add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10); function my_theme_wrapper_start() { echo '<section id="main">'; } function my_theme_wrapper_end() { echo '</section>'; }
JamesGuestIf you prefer adding a theme file you can add
woocommerce.php
which is a catch-all file for Woo. Copy over yourpage
template into a new file with that name and then replace the WordPress loop with the Woo loop which is:<?php woocommerce_content(); ?>
And save.
JeffreyGuestIf you’re going to use the “shortcut” methods mentioned on this thread it’s g
fine and actually recommended, however be sure to learn how to customize WooCommerce CSS.Mastering the CSS can be more useful than generating dozens of theme files.
JaniceGuestMastering the CSS
ah yes that is chapter 3 in Mastering los Interwebz
-
AuthorPosts