GENESIS THEME Countable Errors Fix
Permalink
This error is being caused by a pagelist template.
If you look at:
packages > c5box_genesis > blocks > page_list > templates > c5box_plist_4col_carousel > view.php
you will find on line 16 this code...
Change it to this...
The same applies to this file...
packages > c5box_genesis > blocks > page_list > templates > c5box_plist_3col_carousel > view.php
If you look at:
packages > c5box_genesis > blocks > page_list > templates > c5box_plist_4col_carousel > view.php
you will find on line 16 this code...
<?php if (count($rows) > 0) { ?> <?php foreach (array_slice($rows, 1) as $row) { ?> <i class="fa fa-circle-thin" aria-hidden="true"></i> <?php } } ?>
Change it to this...
<?php if (is_array($rows) ) { // add this line to fix Countable error if (count($rows) > 0) { ?> <?php foreach (array_slice($rows, 1) as $row) { ?> <i class="fa fa-circle-thin" aria-hidden="true"></i> <?php } } } // and this line also ?>
The same applies to this file...
packages > c5box_genesis > blocks > page_list > templates > c5box_plist_3col_carousel > view.php
Yes there are several ways to tackle this problem.
I prefer my method since the code does not belong to me and it would be very easy to return the file to its former state by deleting the two commented lines.
I prefer my method since the code does not belong to me and it would be very easy to return the file to its former state by deleting the two commented lines.
if the first part of the if check fails it won't check the second one so there will be no error