$output = $tg_el->get_media_wrapper_start();
$output .= $tg_el->get_media();
$output .= $tg_el->get_overlay();
$output .= $tg_el->get_center_wrapper_start();
$output .= ($link_button && $media_button) ? '<a class="tg-item-link" href="'.$permalink .'" target="'.$target.'"></a>' : null;
$output .= $media_button;
$output .= $link_button;
$output .= $tg_el->get_center_wrapper_end();
$output .= $tg_el->get_media_wrapper_end();
$output .= $tg_el->get_content_wrapper_start();
$output .= $tg_el->get_the_title();
$output .= $tg_el->get_the_date();
$output .= $tg_el->get_the_terms($terms_args);
$output .= do_shortcode ("[rt_reading_time label='Read Time:' postfix='minutes' postfix_singular='minute']");
$output .= $tg_el->get_content_wrapper_end();
return $output;
You’ll probably need to pass the post id for the post the grid is displaying in the post_id
parameter of the Reading Time shortcode.
Hi Jason my issue with post_id will be all items listed in the grid will have the same minutes
You need to pass the post_id of the post the grid item links to. So you’d get the post_id of the element similar to how you’re getting the title with $tg_el->get_the_title()
.
That should have Reading Time calculate based off the content of the post ID you passed. Rather than the ID of page you display the grid on.