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
- Blank on static home page?
- How to use a frontend URL with a Plugin
- Replace existing content from specific WooCommerce admin orders list column
- How to display blog images using wordpress in existing project
- How to display a value from a radio button in the options menu in wordpress
- Woocommerce filter cart and category specific quantity [closed]
- Custom image upload
- How to display recent posts on home page with custom HTML
- How to get woocommerce cart content without an action?
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Woocommerce product download URL
- Upload Image in a WordPress page using PHP
- Limiting woocommerce line_total decimal length
- Remove price from Woocommerce variable product dropdown menu
- Why the JavaScript code is ignored from wp editor?
- Populate dropdown with Child Pages based on Parent Page chosen
- Get and insert order email address to the PHP template inside HTML text
- If no products are on sale – hide ID or class
- do search in two site and show the result in first site
- How to change redirection route to a php page for making it only accessible by logged-in members?
- Why Won’t My Inputs in a form with a Get method work together?
- How to get the value of input hidden html from text editor to custom page template?
- How to convert select to HTML with PHP tags inside of it [closed]
- Replace Woocommerce “add to cart” to be “Download” button [closed]
- 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
- How to display a custom product field value of a specific category on a Woo Commerce checkout page?
- Personalize checkout text
- 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
- List sub categories and corresponding posts of a parent category
- Woocommerce My acount page
- population category dropdown and sub category onselect
- Get WooCommerce products with similar SKU
- Using Google Analytics in an enqueued JS file
- Use CSS tag inside PHP code
- 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?
- IF statement not working – Any suggestions?
- How do I disable cache for a certain 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
- Get x numbers of a woocommerce category products using Wp_Query
- Get field value and use as variable in php
- Set notification if is two product category in cart
- how to add functions to my function.php using a child theme?
- How can I create a shortcode from an html and php code written together
- Reverse Cross-Sells (WooCommerce)
- 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?
- Multisite – Display different header content based on which site is accessed
- html to posts, jpg to featured image, zip file contains jpg and html
- How do you change the tag font size in the repeater-template.php [closed]
- PHP tag in post content makes wordpress go crazy
- How to only fetch certain Tag ID’s
- Where to find the html for WordPress site? [closed]
- How to remove image on single product and get product to span page?
- How Can I Center the Logo in the Navigation Menu? [closed]
- HTML in PHP problem [closed]
- Getting custom field data from cart page to checkout page in woocomerce [closed]
- 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?