I may have found the problem (from product_attribute)
array(
'per_page' => '12',
'columns' => '4',
'orderby' => 'title',
'order' => 'asc',
'attribute' => 'asc',
'filter' => 'asc'
)
[product_attribute attribute="color" filter="black"]
Notice the attibute is in single quotes wheras yours is in double quotes:
do_shortcode ('[product_attribute attribute="Grams"]');
also you may need it to be in lowercase letters.
From The codex:
IMPORTANT TIP – Don’t use camelCase or UPPER-CASE for your $atts attribute names
$atts values are lower-cased during shortcode_atts( array( ‘attr_1’ => ‘attr_1 default’, // …etc ), $atts ) processing, so you might want to just use lower-case.
Related Posts:
- Woocommerce, ordering products by default on shortcode pages
- Add shortcode support to custom field
- Adding my own custom woocommerce shortcode to child theme, how?
- Show shortcode without executing it
- How to create a shortcode with 1 parameter (atts)
- How does a shortcode work?
- Run visual composer code in php page
- Remove wptexturize from a shortcode?
- Using shortcode in Post title
- Loading shortcode with ajax
- Audio or playlist shortcode condition according to the amount of files on attachment page
- WP_enqueue_script inside shortcode?
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- How to list all active and specific shortcodes in wordpress
- Extending Shortcode attributes
- If numberposts = -1 offset won’t work
- Shortcode are not working in Option tree textarea
- Plugin shortcode won’t work on a custom template file [closed]
- shortcodes displaying outside of content area with echo statement, not what I wanted [duplicate]
- Shortcode is not working in homepage page template (custom front page)
- Font Awesome Icons Won’t Work
- How to Get a part of URL and put in shortcode?
- detect when shortcode ran for the last time
- How can a shortcode can take the place of the featured image in a post?
- Shortcode for Twitter Bootstrap Collapse
- Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?
- get_shortcode_regex() only matches first shortcode
- Different uniqid when calld in wp_localize_script and shortcode
- How do I debug a short code?
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Does registering multiple shortcodes impact performance?
- Gallery shortcode – change link file image size? (not using default fullsize image)
- How can I hide the Permalink/Shortlink for certain user logged in Users of a certain level?
- How to add an automatic refresh in WordPress for a Page/Post or an embedded OneDrive/Excel HTML Code?
- How to force that styles are enqueued in the header?
- add action only if gallery shortcode attribute is equal to?
- How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
- Shortcode for order number [closed]
- Create shortcode in WordPress, using one variable in 3 functions?
- Adding javascript actions to words in post content
- Hide Selection of Text From Archive, but Show on Single Posts
- Custom Shortcode Broken in WordPress 3.1
- Namespaced shortcode?
- How to create an incremental list using shortcodes?
- Displaying shortcode in footer
- Displaying shortcode output through Options Framework
- How to Generate html tags using shortcodes?
- Do shortcode that is inserted in a textarea is not displaying properly
- Adding custom form within add_shortcode
- Use another action instead of the shortcode API to display the last time a user logged in
- how to add shortcode in wordpress container [duplicate]
- Get array of shortcodes within string
- stop WordPress removing shortcode from content [closed]
- How to rewrite URL and get the values?
- Is there a good way to load tiny_mce_popup.js through editor.windowManager.open?
- Adding a custom field to do_shortcode [closed]
- Clearfix Shortcode
- How and when to include shortcode source files
- Use full size images in a specific gallery
- contact form 7 database short codes [closed]
- how to create a fav icon shortcode?
- How to deal with WordPress bug: can’t use wrapped and unwrapped shortcode on same post
- Execute Shortcodes when submitting post
- Video shortcode, option are not rendered
- Create shortcode for each form field in contact form 7
- Auto embeds don’t work for attachment descriptions
- insert og image link in wordpress post
- Date Shortcode in Image alt and title tags
- access shortcode atts in template part
- Why is my shortcode not working?
- Shortcode is not showing content when placed in editor (post_type = page)
- May an attribute have no value?
- How to set up posts per page on WP
- How to insert a short code into Contact Form 7 in WordPress that will call a function once the submit button is pressed
- SQL query to bulk change short code in all posts
- Display shortcode in text field with wordpress settings api
- Unable to make shortcode, what is wrong?
- How to display a page dependent on a url parameter supplied by a form/button page?
- function of parent not working in childtheme
- Push Shortcode parameter to template
- latest posts shortcode with image
- WordPress plugin shortcodes not outputting anything
- WordPress Gallery with ID’s Shortcode not Working
- Featured image with link to post shortcode, image displaying above the post
- Why function hooked using object are executing at all time?
- Video shortcode inside tabs shorcode NOT working
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- How to add meta slider lite or other slider to main page header in pinboard theme
- Escaping a shortcode so it displays as-is [duplicate]
- WordPress do_shortcode first iteration
- If do_shortcode is blank, return some message
- Add a short code to a plugin
- Previous/Next with the same category
- I’ve broken the short code for Contact Form 7!
- echo a shortcode in a shortcode code?
- Applying if (get_post_meta) to new shortcode
- Any way to hook into WP after a page displays?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Add widget/shortcode to sidebar OUTSIDE of the theme
- 3 shortcodes 2 won’t render [closed]