How to change the currency symbol position in wordpress?

I am working on a free wordpress classifieds theme and found more currency symbol idea, but I wish you the price would be after the symbol. eg. 200 $

Here the code:

Read More
<section class="thumb_item">
<?php if (get_post_meta($post->ID, 'price', true) !== '') { ?>
<span class="price"><?php
if(get_option('currency') != ''){
echo get_option('currency');
}else{
echo get_option('currency_symbol');
}
echo get_post_meta($post->ID, 'price', true);
?></span>
<?php } ?>

Thank you for your help.

Related posts

Leave a Reply

1 comment

  1. The answer is to change the order of the echo:

    <section class="thumb_item">
        <?php if (get_post_meta($post->ID, 'price', true) !== '') { ?>
            <span class="price"><?php
            // Moved the following line from the end to here so echos price first
            echo get_post_meta($post->ID, 'price', true);
            // Now echo the currency symbol
            if(get_option('currency') != ''){
                echo get_option('currency');
            }else{
                echo get_option('currency_symbol');
            }
        ?></span>
    <?php } ?>