Modify custom field value before desplaying it
-
I have a custom field called ‘story_title’, which I use in many places in my template. For various reasons, it’s now necessary to give some posts with particular ‘story_title’ values additional CSS formatting. What I need is a way to insert ‘story_title’ into a div class: <div class=”Title Goes Here”>. Except as I understand CSS, spaces in a div class aren’t a good idea. So I need a way to remove all spaces and replace them with another character, like a dash or a underscore. Is there a way to do this?
I’ve considered using post id numbers instead, but numbers aren’t very helpful when I’m scanning through and editing css stylesheets.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Modify custom field value before desplaying it’ is closed to new replies.