WordPress.org

Support

Support » How-To and Troubleshooting » get_post_custom_values problem

get_post_custom_values problem

  • I’m using the custom fields to add a few things to posts.

    Example:
    <a href="<?php $values = get_post_custom_values("url"); echo $values[0]; ?>" title="<?php the_title(); ?>">

    Lets say my site is www.mysite.com. I choose to put in the custom field “url” the site www.othersite.com. That means the link in the example should direct there. But when I go to the post, when I hover over the link it displays as www.mysite.com/www.othersite.com. Same as when I click on the link.

    Now here is where it gets weird. If I go to view source on the browser and look at the code, it will show the link as <a href="www.othersite.com">posttitle</a>, not www.mysite.com/www.othersite.com.

    This is only occurring with the links where I use get_post_custom_values. Other links on the page are unaffected.

    I am utterly lost on this one. Anyone got any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get_post_custom_values problem’ is closed to new replies.
Skip to toolbar