First I need to remove a period at the end of this function which displays a description on my wordpress theme. For example a particular description will display as........... Visit the wonderful city.
<?php post_description(); ?>
After removing period, I need to add a city at the end of first function to make it 1 sentence, such as...Visit the wonderful city of Akron.
This is the taxonomy code that displays the city
<?php echo appthemes_get_custom_city($post->ID, CITY_TAX_NAME, 'name'); ?>**
here is entire code............
<!-- #main -->
</div> <!-- #head-box -->
<div class="box-bottom"> </div>
<div class="text-box">
<?php appthemes_before_post_description(); ?>
<?php appthemes_post_description(); ?>
<?php post_description(); ?>
<?php city_edit_link(); ?>
<?php clpr_reset_link(); ?>
<?php appthemes_after_post_description(); ?>
</div>
now I implemented this code.........
<?php
$content = trim(get_the_content());
if(substr($content, -4) == '</p>') {
echo substr($content, 0, -4);
echo appthemes_get_custom_city($post->ID, CITY_TAX_NAME, 'name');
echo '</p>';
}
else{
echo $content, of, " ", appthemes_get_custom_city($post->ID, CITY_TAX_NAME, 'name');
echo '.';
} ?>
But it displays as......... Visit the wonderful city. of Akron.
How can I remove the period while allowing period at end of sentence.