Categories
CMS Development Wordpress

How to fix this error? “FATAL ERROR syntax error, unexpected ‘<', expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line number 88"

I’m getting an error at the 88th line “FATAL ERROR syntax error, unexpected ‘<‘, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF)” It broke my site, how can I fix it? (I’m new to coding)

Thank you!!

<?php
/**
 * Related Products
 *
 * @see         https://docs.woocommerce.com/document/template-structure/
 * @author      WooThemes
 * @package     WooCommerce/Templates
 * @version     3.9.0
 */

if ( ! defined( 'ABSPATH' ) ) exit;

if ( $related_products ) :
    $position = minera_get_sidebar_position();

    $slider_related = '';
    if(count($related_products) > 3){
        $slider_related = 'slider-related-product';
        wp_add_inline_script(
            'minera-theme-slick',
            "jQuery(window).on('load', function(){
                jQuery('.slider-related-product .products').slick({
                    slidesToShow: 3,
                    slidesToScroll: 1,
                    infinite: false,
                    arrows: true,
                    dots: true,
                    fade: false,
                    responsive: [
                        {
                            breakpoint: 992,
                            settings: {
                                slidesToShow: 2
                            }
                        },
                        {
                            breakpoint: 370,
                            settings: {
                                slidesToShow: 1
                            }
                        }
                    ]
                });
            });",
            'after'
        );
    }else{
        $slider_related = 'mobile-slider-related-product';
        wp_add_inline_script(
            'minera-theme-slick',
            "var width = matchMedia('(max-width: 991px)');
            function minera_single_product_related(data) {
                if(data.matches){
                    jQuery('.mobile-slider-related-product .products').slick({
                        slidesToShow: 2,
                        slidesToScroll: 1,
                        infinite: false,
                        arrows: true,
                        dots: true,
                        fade: false,
                        responsive: [
                            {
                                breakpoint: 370,
                                settings: {
                                    slidesToShow: 1
                                }
                            }
                        ]
                    });
                }else{
                    if(jQuery('.mobile-slider-related-product .products').hasClass('slick-initialized')){
                        jQuery('.mobile-slider-related-product .products').slick('unslick');
                    }
                }
            }

            minera_single_product_related(width);
            width.addListener(minera_single_product_related);",
            'after'
        );
    } ?>

    <section class="related products">

        <?php
        $heading = apply_filters( 'woocommerce_product_related_products_heading', __( 'Related products', 'woocommerce' ) );

    <section class="related products" <?php echo esc_attr($slider_related); ?>">
        <?php echo 'full' == $position ? '<div class="container">' : ''; ?>
        <h2 class="related-title"><?php esc_html_e( 'Related products', 'minera' ); ?></h2>

        if ( $heading ) :
            ?>
            <h2><?php echo esc_html( $heading ); ?></h2>
        <?php endif; ?>
        <?php woocommerce_product_loop_start(); ?>
            <?php foreach ( $related_products as $related_product ) : ?>
                <?php
                    $post_object = get_post( $related_product->get_id() );
                    setup_postdata( $GLOBALS['post'] =& $post_object ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, Squiz.PHP.DisallowMultipleAssignments.Found

                    wc_get_template_part( 'content', 'product' );
                    ?>

            <?php endforeach; ?>

        <?php woocommerce_product_loop_end(); ?>

    </section>
    <?php
endif;

wp_reset_postdata();

Leave a Reply

Your email address will not be published. Required fields are marked *