Woocommerce jquery replace word with image in wordpress



notes for Woocommerce jquery replace word with image in wordpress:

in wp-content/themes/mytheme/library/js

$('.short-description').each(function() { var txt = $(this).text(); var img = '<img src="'+uploadDir+'/asdf.png" alt="' + txt + '" />' var html = txt.replace(/asdf/g, img); // replace every star with an image tag $(this).html(html); });



Tags:
Veröffentlicht: 12.2014