How to get custom field value in the code
-
I have set a custom field “link” for post and give it a value,such as “https://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 https://www.123.com/array
123.com is my webste
abc.com is the value of custom field “link” for some postHow should I fix the code sentence to get right link value return?
Thank you.
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘How to get custom field value in the code’ is closed to new replies.