Custom field not giving any return value

I have created a custom field named ‘end_date’ which is used to display all news published before this date. So these news are considered as latest news.For latest news i have set the image width as 600px so tht i can identify they are getting into latest news. But the problem is they arent getting in. so i tried var dumping the enddate variable and its returning ” eventhough its entering in the database. Please help

$news = wp_get_recent_posts($args,false);
    echo "<div class='row'>";
    foreach( $news as $row)
      $main = get_post_meta($newsid,'main_story',true);



      if($time <= $enddate)
        echo "<div class='row'>";
        $image = get_post_meta($newsid,'_thumbnail_id',true);

        echo "<div class= 'col-lg-4'><table style='width:200px;'><tr><td><img src='". wp_get_attachment_image_src($image)[0]."'style='width:600px;'></td></tr>";

Read more here: Custom field not giving any return value

Leave a Reply

Your email address will not be published. Required fields are marked *