I have set a custom field “link” for post and give it a value,such as “http://www.abc.com” differently for each post.
In templates, I need to get the link value, some current code sentence is like the under:
return '<span class=\'clear\'><a class=\'readmore\' href=\''. get_post_custom($post->ID, 'link', true). '\'>' . __( 'Read More', 'Jen') . '</a></span>';
but only return http://www.123.com/array
123.com is my webste
abc.com is the value of custom field “link” for some post
How should I fix the code sentence to get right link value return?
- The topic ‘How to get custom field value in the code’ is closed to new replies.