removed related posts if none by checking for array

This commit is contained in:
Ross Trottier 2024-09-11 12:41:37 -06:00
parent e2f1f3442d
commit 3731b72c5b

View File

@ -33,7 +33,7 @@
<?php <?php
if (function_exists('get_field')) { if (function_exists('get_field')) {
$related_posts = get_field('related_posts', $post_id); $related_posts = get_field('related_posts', $post_id);
if (isset($related_posts)) : ?> if (isset($related_posts) && is_array($related_posts)) : ?>
<div class="st-sub-grid"> <div class="st-sub-grid">
<h3>Related Articles</h3> <h3>Related Articles</h3>
<div class="st-article-section-related-articles"> <div class="st-article-section-related-articles">