short description in shop page after title

Question

hello i’m using this code in my functions.php file to display a short description in shop page (woocommerce page)
but the discription goes before the title can some one help me please to display it after the title thank you

  $excerpt = explode(' ', get_the_excerpt(), $limit);
  if (count($excerpt)>=$limit) {
    array_pop($excerpt);
    $excerpt = implode(" ",$excerpt).'...';
  } else {
    $excerpt = implode(" ",$excerpt);
  } 
  $excerpt = preg_replace('`[[^]]*]`','',$excerpt);
  return $excerpt;
}


function woocommerce_after_shop_loop_item_title_short_description() {
    if ( has_excerpt() ) :
        ?>
        <div itemprop="description">
            <?php echo apply_filters( 'woocommerce_short_description', excerpt(10) ) ?>
        </div>
        <?php
    endif;
}
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_after_shop_loop_item_title_short_description', 5 );```
0
, , , marya 7 months 0 Answers 103 views 0

Leave an answer