Getting custom fields and contents from a single page
-
I’m encountering weird issues I got a page where it list all the videos so if you click the video you will be redirected into single-page-video where you see the information of the video and custom fields.
I tried to codes this one is I’m not able to echo or get the custom fields.
$postid = get_the_ID(); $vidtemss = get_post_meta($post_id , 'thai-videos', true ); if(!empty($vidtemss)) { foreach ($vidtemss as $link) { $vidcontent = get_the_content(); $viddate = get_the_time('F d, Y'); $vidurl = $link['yt-url']; } }
But this one I’m able to get the custom fields but the problem is I can’t get the the_content or get_the_content(). the_title is working well.
$vidtemss = get_post_meta($post->ID, 'thai-videos', true ); if(!empty($vidtemss)) { foreach ($vidtemss as $link) { $vidcontent = get_the_content(); $viddate = get_the_time('F d, Y'); $vidurl = $link['yt-url']; } }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Getting custom fields and contents from a single page’ is closed to new replies.