Boris
Boris

Reputation: 641

Changing structure of WooCommerce shortcode

I have installed WooCommerce on my page, and I'm displaying features posts using shortcode inside of a php file.

<?php echo do_shortcode('[featured_products per_page="3" columns="3"]'); ?>

It displays features products, but the problem is that its displaying them in UL and LI elements. Is there a way I can change how its displayed(for example displaying them inside of a bootstrap row and columns), so it can match the structure of my front end.

Upvotes: 2

Views: 4174

Answers (1)

Rajkumar Gour
Rajkumar Gour

Reputation: 1159

Yes you can easily do it. Please follow the below instructions

  1. Create a folder named "woocommerce" in your theme folder.
  2. Copy template files in directory wp-content/plugins/woocommerce/templates from woocommerce plugin folder and paste these files in the woocommerce folder of your theme.
  3. Now you can modify WooCommerce templates from your theme.
  4. Open loop folder and edit loop-start.php and loop-end.php remove <ul> and place your bootstrap divs here.
  5. Open content-product.php to change the <li> to your bootstrap columns.

Upvotes: 4

Related Questions