shortcode not working [closed]

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.

Leave a Comment