php - Error with Woocommerce short description in category page -
this code i'm using , appears work correctly when log in
add_action('woocommerce_after_shop_loop_item_title', 'lk_woocommerce_product_excerpt', 35, 2); if (!function_exists('lk_woocommerce_product_excerpt')) { function lk_woocommerce_product_excerpt() { $content_length = 10; global $post; $content = $post->brief_description; $wordarray = explode(' ', $content, $content_length + 1); if (count($wordarray) > $content_length) : array_pop($wordarray); array_push($wordarray, '...'); $content = implode(' ', $wordarray); $content = force_balance_tags($content); endif; echo "<span class='excerpt'><p>$content</p></span>"; } }
when logout , check page, first product in each category doesn't show short description added, although appears when i'm login.
is there problem code?
how should be: http://imgur.com/lnydygg
how when logout: http://imgur.com/xlmnv83
Comments
Post a Comment