I am new to this and I don't know php. I get this error on WordPress posts:
Warning: count(): Parameter must be an array or an object that implements Countable in /www/tastingvictoria_289/public/wp-content/themes/astra-child/single.php on line 32 Which where if(count($related_article) > 0){?> is.
Here is the file it is coming from. Is it a syntax thing?
Any cue? Thanks
<div id="primary" <?php astra_primary_class(); ?>>
<?php astra_primary_content_top(); ?>
<?php
$related_article = get_field( "select_article", 'option' );
if(count($related_article) > 0){
?>
<?php
?>
<div class="article">
<div class="wrap">
<a href="<?php echo $link; ?>">
<div class="article-image" style="background-image: url(<?php echo $post_thumb; ?>);"></div>
</a>
<div class="infos">
<div class="infos-wrap">
<p class="date"><?php echo $postdate; ?></p>
<a href="<?php echo $link; ?>"><h4 class="title"><?php echo $title; ?></h4></a>
<p class="excerpt"><?php echo $excerpt; ?></p>
</div>
</div>
</div>
</div>
<?php
}
?>
<?php
?>
</div><!-- #primary -->
<?php if ( astra_page_layout() == 'right-sidebar' ) : ?>
<?php get_sidebar(); ?>
<?php endif ?>