• Resolved Rose

    (@eos-rose)


    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)
  • you want to auto-add underscores to multiple instances of a div class? I don’t know there’s a ready to go way to do that. Maybe I’m not clear on the issue?

    Thread Starter Rose

    (@eos-rose)

    Yes, that’s pretty much what I want to do. Honestly, I’ll be surprised if there *is* a way to do it, but it never hurts to ask, right? In the meantime, I can use post ids; it’ll just be harder.

    never hurts to ask, only answer (haha) seems if you have to go through all your classes and change to post ids, why not just add underscores to the post titles? feels like I’m missing something.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modify custom field value before desplaying it’ is closed to new replies.