Adding a short desc under a section/product
-
Not strictly related to WP more of a PHP syntax query.
I found this bit of code to put a short description under a product in Woocommerce. Unfortunately it was pasted onto the help site incorrectly and so, ‘almost’ works.
Can anyone tell me what is wrong with the last Echo, part – the & and quot parts, I know they need changing but PHP and coding on the fly is new to me.
CODE START
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(){ echo ‘<span class="excerpt">’;
the_excerpt(); echo ‘</span>’; } }
CODE ENDI have tried a few variants replacing the & with & and so on, but nothing works so far, it either crashes the site or displays the excerpt and part of the code.
Any pointers appreciated.
McP.
- The topic ‘Adding a short desc under a section/product’ is closed to new replies.