Your account expired support, please renew to get your support.

Home Forums Themes Support Circle Warning: Invalid argument supplied for foreach() in …

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8543
    filmart
    Support Expired

    Hello!
    There is an error in the single video page, it is showed in more than one video page in my website.

    It comes out below the video and on the left of the video description, here is the error:

    Warning: Invalid argument supplied for foreach () in /wp-content/themes/haru-circle/templates/single/content-haru-video.php on line 102

    It seems to come out when you don’t fill the “More Information” fields.

    You can view it at the link below:

    Resistere e ripartire con Rio Mare Nutre lo Sport

    Attachments:
    You must be logged in to view attached files.
    #8547

    Hi,
    Thanks for contacting us and choosing our product!
    That seems this issue happen when you don’t have any fields insert in section Video Info.
    We have just fixed this by go to: wp-content/themes/haru-circle/templates/single/content-single-video.php
    Go to line 102 and change the code from:

    <?php foreach( $video_more_info as $more_info ) : ?>
                                    <div class="more-info">
                                        <h6 class="info-label"><?php echo esc_html( $more_info['0'] ); ?></h6>
                                        <div class="info-value"><?php echo wp_kses_post( $more_info['1'] ); ?></div>
                                    </div>
                                    <?php endforeach; ?>

    to

    <?php if ( $video_more_info ) : ?>
                                    <?php foreach( $video_more_info as $more_info ) : ?>
                                    <div class="more-info">
                                        <h6 class="info-label"><?php echo esc_html( $more_info['0'] ); ?></h6>
                                        <div class="info-value"><?php echo wp_kses_post( $more_info['1'] ); ?></div>
                                    </div>
                                    <?php endforeach; ?>
    								<?php endif; ?>

    Now it’s working fine.

    ****
    Regards,
    HaruTheme

    #8558
    filmart
    Support Expired

    Thankyou! 🙏

    #8559

    Thanks for your feedback!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.