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']; } } -
Hi there. https://blademaster556.wordpress.com/ does not have any content. Please provide the URL of the site with which you need assistance.
-
If you have a self-hosted WordPress.org site, please visit the WordPress.org support forum for assistance as we won’t be able to help you here: http://wordpress.org/support/ If you don’t already have a username on that forum, click the register button in the upper right corner so you can post in that forum.
This support forum is only for free WordPress.com blogs. WordPress.com and WordPress.org are completely separate and different: http://en.support.wordpress.com/com-vs-org/
- The topic ‘Getting custom fields and contents from a single page’ is closed to new replies.