I am having trouble implementing inline cm/inch conversion inside WordPress.
I was using plugin called “Unit Converter” http://wordpress.org/extend/plugins/unit-converter/ and it worked fine when I adjusted it to work with custom meta boxes. It showed inline conversion from cm to inches.
Now I created custom search so I no longer can add “cm” at the end of each number and converter no longer works.
Height: <?php echo rwmb_meta( 'iz_height' ); ?> cm</li>
Since size value now comes from custom meta boxes but “cm” sign from theme this plugin I mentioned no longer works.
How to make this plugin work or how I can convert these units without using plugins.
Basically I am looking for solution to convert “RandomNumber cm” to inches.
One way is to create a shortcode for it
Can be used like this
But remember, when you display content it doesn’t automatically get parsed through
do_shortcode
. Let’s say you’ve saved some meta box information as a site option. Then do it like this: