Sp0cK Posted February 28, 2017 Share Posted February 28, 2017 (edited) This is probably the lamest question you will see today, but for me the hardest to answer: sprintf( __( '%1$s起', 'woocommerce' ) I would like to style the character 起 with a span sort of like this: '%1$s'<span style='font-size: 10px;'起'</span>, 'woocommerce' ) I'm pretty sure I've got my quotes all wrong in this example. How do I do this the correct way if possible at all? It's on a live site so i can't play around with it too much... Thanks! The full line is: $saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s起', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); Edited February 28, 2017 by Sp0cK Quote Link to comment https://forums.phpfreaks.com/topic/303311-inserting-span-into-php-code/ Share on other sites More sharing options...
requinix Posted February 28, 2017 Share Posted February 28, 2017 $saleprice is being outputted into the HTML somewhere. That's where you should add the span. But first look to make sure there isn't already a way to style the element as it currently exists on the page. Quote Link to comment https://forums.phpfreaks.com/topic/303311-inserting-span-into-php-code/#findComment-1543509 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.