WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] html code in custom fields (9 posts)

  1. Beee
    Member
    Posted 6 years ago #

    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)

  2. SteveSmith1983
    Member
    Posted 6 years ago #

    It's been reported as a bug - it's annyoing isn't it! I suppose it will be fixed in the next release.

  3. educationthemes
    Member
    Posted 6 years ago #

    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?

  4. SteveSmith1983
    Member
    Posted 6 years ago #

    Ahh, hadn't thought of that!

  5. educationthemes
    Member
    Posted 6 years ago #

    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.

  6. Beee
    Member
    Posted 6 years ago #

    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...

  7. Beee
    Member
    Posted 6 years ago #

    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 :)

  8. educationthemes
    Member
    Posted 6 years ago #

    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.

  9. Beee
    Member
    Posted 6 years ago #

    did change it and works easy now

Topic Closed

This topic has been closed to new replies.

About this Topic