You don’t have the $post
object, but trying to use it in the code ($post->ID
). Use get_the_ID()
function instead:
<?php
while ( $cat_query->have_posts() ) : $cat_query->the_post();
// $gread = get_post_meta( $post->ID, 'read_time', true ); // Wrong
$gread = get_post_meta( get_the_ID(), 'read_time', true ); // Right
endwhile;
}
From now forth always enable debugging when you develop. In such a way you’ll avoid wasting your time and asking unpractical questions.