I’ve got a custom field for my client’s site to display a custom tag.
Content in the custom field can be:
modern-art
abstract-art
artist
To template code to display the tag is:
<a href="http://site.com/tag/<?php echo get_post_meta($post->ID, 'hp-custom-tag', true) ?>"><?php echo get_post_meta($post->ID, 'hp-custom-tag', true) ?></a>
Of course, I don’t want to display the dash between modern-art. How can I remove the dash character using PHP or JS?
PHP
str_rplace()