Support » Fixing WordPress » html code in custom fields

  • Resolved Beee

    (@beee)


    I have 1 custom field per post on http://www.b1k1n1.com (NSFW)
    the field is called provided and the value is something like

    <a href='http://www.b1k1n1.com' target='_blank'>Bikini Babes</a>

    If I save this it gets saved as

    <a href=\'http://www.b1k1n1.com\' target=\'_blank\'>Bikini Babes</a>

    and leaves the url broken

    If I remove the slashes it works again. Any ideas on how to do this properly ? (as in not having to change it manually)

Viewing 8 replies - 1 through 8 (of 8 total)
  • It’s been reported as a bug – it’s annyoing isn’t it! I suppose it will be fixed in the next release.

    why not try putting the <a href=" and the </a> in your template file and then the custom field will just be:

    <a href='http://www.b1k1n1.com'>Bikini Babes</a>

    Thats what I do and haven’t had the problems?

    Ahh, hadn’t thought of that!

    sorry the custom field would just be

    http://www.b1k1n1.com without the a tags if they are on the tempalte file.

    Like I said working for me with 2.6.

    I like the idea, have to figure it out, but then I have to make 2 custom fields, one for the url and one for the name, right ???

    Just thought of something. If I do change to this, I have to edit all 300 posts manually again 🙂 so i’ll think twice…

    just tried it out… works very nice, better than my solution, have to admit that, but editing 300 posts is not something I want to do 🙂

    Glad it works, but I can see your point about updating 300 posts 🙁

    I tend to make site for other people and therefore I need them to be as simple as possible for the user. Therefore putting all the html tags in the template makes sense so they don’t have to worry about them.

    In fact i would even put in the http:// as moust don’t always enter that when typing a web address in.

    I suppose a personal site it is easier any way really as long as you know yourself.

    did change it and works easy now

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘html code in custom fields’ is closed to new replies.