If I understand your question correctly:
<?php
global $product;
$sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are defined ?>
<ul class="list-group">
<?php foreach($sizes as $size){ ?>
<li class="list-group-item"><?php echo $size; ?></li>
<?php } ?>
</ul>
<?php } ?>
Related Posts:
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Function returns text instead of html [closed]
- How to remove coupon dropdown feature
- Add html link in functions.php files of the theme
- How to rename woocommerce-billing-fields
- PHP function for horizontal Woocommerce thumbnails and badges
- Remove span tags from WooCommerce Downloads page
- Use Search Term in html link and redirect
- Custom woocommerce payment gateway – Form
- sessionStorage saves input value in browser but it is not loaded in the form field
- WooCommerce multiple custom fields code
- Can’t make product images clickable
- WooCommerce – Print Processing orders [closed]
- How to create a container in php then customise it in CSS
- Endpoint exists and shows up in My Account dashboard. Need to add endpoint to My Account DROPDOWN menu in Porto theme
- How to correctly add Javascript in functions.php
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- Multiple pages on one with different HTML
- Woocommerce: How to override core functions in functions.php?
- Add custom HTML to posts page
- Get WooCommerce shipping methods programmatically
- Add a custom text field to WooCommerce admin product data “Variations”
- Minify HTML, CSS, JS with PHPWee?
- Add attribute / custom attribute to product in woocommerce
- How to only show page id as body class?
- Shortcode content output but not in correct place
- Help with some php math in WordPress
- combine Code 1 with Code 2
- Adding nofollow to a PHP generated Nav
- Show prices with tax in Woocommerce Mini Cart [closed]
- Problem with custom plugin using AJAX to pull info from php file
- Reload part of checkout on changed shipping method
- Woocommerce related product text
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Function works when I don’t login to WordPress but when I login then it doesn’t work
- How to make products with no cost in WooCommerce
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Input data from email form not going to JSON file
- How to get private property in parent class into extended class?
- Woocommerce Email attachments not working – file not being attached
- Add Codepen animation as Preloader to WordPress
- php within html within php
- php esc_html_e with an html link inside not working
- Using ob_start and ob_get_clean with wordpress shortcode
- WordPress wp-admin redirect and exception
- WooCommerce pages looks unstyled
- Creating an image from a custom field
- Disable if there are no children – Woocommerce
- WordPress forms submissions and PHP files
- Function Display article [closed]
- Custom Taxonomy Select Menu: Setting default option value?
- How to get the second slug of a page url?
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- custom add note meta box with add button in wordpress
- Display Sibling WooCommerce Product Categories on Archive Page
- How to sort WooCommerce products page by latest in-stock items first?
- WP_Query for woocommerce products with a pattern as a post_title
- Generate images with html2canvas and the woocommerce api
- How to update ticket price programatically when adding to cart and checkout in woocommerce
- Get WooCommerce products with similar SKU
- Set ACF on order during checkout
- Add Link to PHP message
- Hide payment method based on user role AND minimum cart value
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- How do I disable cache for a certain page?
- How can I edit the final HTML structure of the whole web page
- WooCommerce function not working correctly after moving from the functions.php into a class
- Filter for product subcategory listing page load
- Reduce Stock Based on Custom Variation Field Rather than Attribute (Working Script)
- Install functionality for push notifications but WP-Theme has oddly-named, hidden source files [closed]
- AJAX and custom pages
- Set notification if is two product category in cart
- AJAX to add to cart multiple products woocommerce
- how to add functions to my function.php using a child theme?
- Reverse Cross-Sells (WooCommerce)
- WooCommerce – Add Shipping class below each product in Shopping Cart page
- Use PHP to inject HTML into before page renders?
- WooCommerce Custom Tab with ACF Repeater Field
- How to make a parent page for author.php?
- How do you change the tag font size in the repeater-template.php [closed]
- PHP tag in post content makes wordpress go crazy
- Display product attributes for current product
- How to only fetch certain Tag ID’s
- Where to find the html for WordPress site? [closed]
- RegExp to EXCLUDE strip HTML (FOR SOMME) comments
- Pagination for div’s
- Adding placeholder text field to woocommerce checkout [closed]
- HTML in PHP problem [closed]
- Getting custom field data from cart page to checkout page in woocomerce [closed]
- Send a custom notification to customer on WooCommerce cancelled order status
- How to code bulk order form in wordpress
- Add multiple HTML attributes to an Elementor button
- Remove Woocommerce product from cart with ajax/fetch
- Automatically change insurance quantity based on cart total [closed]
- Why does WordPress not send the user the email to add a password?
- WooCommerce Modal Fly cart on add to cart – With AJAX
- Hide ‘Downloadable’ and ‘Virtual’ checkbox options from Woocommerce Variations?
- How to show correct td of table tags in wp_query loop
- Using WooCommerce Hooks to add product attribute descriptions to customer order email