Jump to content

Looking to resolve 4 issues with new theme - Thanks


MrBishop
Go to solution Solved by MrBishop,

Recommended Posts

1. PHP Deprecated:  Required parameter $width follows optional parameter $attach_id in \htdocs\wordpress\wp-content\plugins\case-theme-core\inc\helpers\resize-image.php on line 23

Code: 

function ct_resize( $attach_id = null, $img_url = null, $width, $height, $crop = false ) {                                        Line 23
        // this is an attachment, so we have the ID
        $image_src = array();
        if ( $attach_id ) {
            $image_src = wp_get_attachment_image_src( $attach_id, 'full' );
            $actual_file_path = get_attached_file( $attach_id );
            // this is not an attachment, let's use the image url
        } elseif ( $img_url ) {
            $file_path = wp_parse_url( $img_url );
            $actual_file_path = rtrim( ABSPATH, '/' ) . $file_path['path'];
            $orig_size = getimagesize( $actual_file_path );
            $image_src[0] = $img_url;
            $image_src[1] = $orig_size[0];
            $image_src[2] = $orig_size[1];
        }

2. Trying to access array offset on value of type bool in \htdocs\wordpress\wp-content\themes\intime\elementor\templates\widgets\ct_service_carousel\layout1.php on line 107

Code:

<div id="<?php echo esc_attr($html_id) ?>" class="ct-service-carousel1 ct-slick-slider">
    <div <?php ct_print_html($widget->get_render_attribute_string( 'inner' )); ?>>
        <div <?php ct_print_html($widget->get_render_attribute_string( 'carousel' )); ?>>
        <?php
            foreach ($posts as $post):
                $img_id       = get_post_thumbnail_id( $post->ID );
                $img          = ct_get_image_by_size( array(
                    'attach_id'  => $img_id,
                    'thumb_size' => $img_size,
                ) );
                $thumbnail    = $img['thumbnail'];

                $img_small          = ct_get_image_by_size( array(
                    'attach_id'  => $img_id,
                    'thumb_size' => '170x90',
                ) );
                $thumbnail_small    = $img_small['thumbnail'];

                $service_except = get_post_meta($post->ID, 'service_except', true);
                $icon_type = get_post_meta($post->ID, 'icon_type', true);
                $service_icon = get_post_meta($post->ID, 'service_icon', true);
                $service_icon_img = get_post_meta($post->ID, 'service_icon_img', true);
                if(!empty($service_icon_img)) {
                    $icon_img = ct_get_image_by_size( array(
                        'attach_id'  => $service_icon_img['id'],
                        'thumb_size' => 'full',
                    ));
                    $icon_thumbnail = $icon_img['thumbnail'];        Line 107
                }
            ?>

 

3. PHP Warning:  Trying to access array offset on value of type bool in \htdocs\wordpress\wp-content\themes\intime\inc\template-tags.php on line 1169

code:

if(!function_exists('intime_get_service_layout1')){
    function intime_get_service_layout1($posts = [], $settings = []){
        extract($settings);
        if (is_array($posts)):

            foreach ($posts as $key => $post):
                $item_class = "grid-item col-xl-{$col_xl} col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-{$col_xs}";
                $filter_class = ct_get_term_of_post_to_class($post->ID, array_unique($tax));
                $service_except = get_post_meta($post->ID, 'service_except', true);
                $icon_type = get_post_meta($post->ID, 'icon_type', true);
                $service_icon = get_post_meta($post->ID, 'service_icon', true);
                $service_icon_img = get_post_meta($post->ID, 'service_icon_img', true);
                if(!empty($service_icon_img)) {
                    $icon_img = ct_get_image_by_size( array(
                        'attach_id'  => $service_icon_img['id'],
                        'thumb_size' => 'full',
                    ));
                    $icon_thumbnail = $icon_img['thumbnail'];                         Line 1169
                }
                ?>

 

4. Trying to access array offset on value of type null in \htdocs\wordpress\wp-content\themes\intime\elementor\templates\widgets\ct_point\layout1.php on line 23

Trying to access array offset on value of type null in \htdocs\wordpress\wp-content\themes\intime\elementor\templates\widgets\ct_point\layout1.php on line 26

Code:

<?php if(isset($item_list) && !empty($item_list) && count($item_list)): ?>
    <div class="ct-point">
        <?php if(!empty($bg_image)) {
            $img = ct_get_image_by_size( array(
                'attach_id'  => $bg_image['id'],
                'thumb_size' => 'full',
            ));
            $thumbnail = $img['thumbnail']; ?>
            <div class="ct-point-image">
                <?php echo wp_kses_post($thumbnail); ?>
                <?php foreach ($item_list as $key => $value):
                    $icon  = ct_get_image_by_size( array(
                        'attach_id'  => $value['icon']['id'],                    Line 23
                        'thumb_size' => 'full',
                    ) );
                    $point_icon    = $icon['thumbnail'];                   Line 26
                    ?>
                    <div id="<?php echo esc_attr($html_id.$key); ?>" class="ct-point-item">
                        <?php if($value['point_type'] == 'default') : ?>
                            <?php if(!empty($value['item_id'])) { ?><div class="id-<?php echo esc_attr($value['item_id']); ?>"><?php } ?>
                                <div class="ct-point-default <?php echo esc_attr($ct_animate); ?>"><span></span></div>
                            <?php if(!empty($value['item_id'])) { ?></div><?php } ?>
                        <?php endif; ?>

                        <?php if($value['point_type'] == 'icon') : ?>
                            <?php if(!empty($value['item_id'])) { ?><div class="id-<?php echo esc_attr($value['item_id']); ?>"><?php } ?>
                                <div class="ct-point-icon <?php echo esc_attr($ct_animate); ?>">
                                    <?php echo wp_kses_post($point_icon); ?>
                                </div>
                            <?php if(!empty($value['item_id'])) { ?></div><?php } ?>
                        <?php endif; ?>

                        <?php if($value['point_type'] == 'highlight') : ?>
                            <?php if(!empty($value['item_id'])) { ?><div class="id-<?php echo esc_attr($value['item_id']); ?>"><?php } ?>
                                <div class="ct-point-meta">
                                    <div class="ct-point-meta-inner">
                                        <?php if(!empty($value['number'])) : ?>
                                            <div class="ct-point-number">
                                                <span class="ct-counter-number-value" data-duration="2000" data-to-value="<?php echo ct_print_html($value['number']); ?>" data-delimiter=",">0</span>
                                                <span><?php echo ct_print_html($value['number_suffix']); ?></span>
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="20" viewBox="0 0 16 20"><g><path d="M0,15l16,5L3,0Z"/></g></svg>
                                            </div>
                                        <?php endif; ?>
                                        <?php if(!empty($value['title'])) : ?>
                                            <div class="ct-point-title"><?php echo ct_print_html($value['title']); ?></div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php if(!empty($value['item_id'])) { ?></div><?php } ?>
                        <?php endif; ?>
                        <div class="ct-inline-css"  data-css="
                            .ct-point #<?php echo esc_attr($html_id.$key) ?> {
                                left: <?php echo esc_attr($value['left_positioon']['size']); ?>%;
                                top: <?php echo esc_attr($value['top_positioon']['size']); ?>%;
                            }">
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php } ?>

 

debug.log.txt

Link to comment
Share on other sites

I'm waiting for my WSL distro to switch from v1 to v2, so here's a little bit:

#2 - $icon_img is a boolean, not an array. I'm not sure what ct_get_image_by_size() does, but it's probable something went wrong with it.

#3 - See #2

#4a - Probably related to #2

#4b- Definitely related to #2.

  • Like 1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.