Tuesday, 15 April 2014

woocommerce - Changing a string in WordPress -



woocommerce - Changing a string in WordPress -

i'm trying alter "tag" "brand" on woocommerce. i've googled, read gettext, tried several other options none have worked.

the line of code in theme is

<?php echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'tag:', 'tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' ); ?>

what's proper (upgrade-proof) way alter word "tag"? know shouldn't edit theme directly.

should edit .mo , .po files? edited .po didn't take on alter (i'm supposed generate .mo afterwards somehow?)

other links said add together filter wp theme's functions.php.

woocommerce recommend plugin http://docs.woothemes.com/document/woocommerce-localization/, server runs out of memory , can't finish rescan process.

i'm confused @ number of options , workarounds needed alter string. did miss other options?

the .po/.mo alternative feasible if site in another language, , yes need generate .mo file 1 wp reads.

a simpler way creating child theme , substituting file through it.

another alternative utilize this plugin, adjusting context frontend , post type product. beware that's expensive plugin goes through all translatable strings of page (and more).

finally, utilize jquery or js it. using hook wp_footer , conditional tag target specific page(s).

wordpress woocommerce

No comments:

Post a Comment