Fatal Error after activating Theme in Wordpress

1

After installing a template and activating it, I receive this message (attached capture)

I copy the content of the post-media.php document the truth is that I have reviewed and I do not know what to do ... Thanks for the help!

<?php
/**
 * Biger Post Thumbnail
 * @since 1.0.1
*/
if(!function_exists('biger_post_thumbnail')){
    function biger_post_thumbnail($args=[]){
        if(!has_post_thumbnail()) return;
        $args = wp_parse_args($args,[
            'id'             => null,
            'thumbnail_size' => is_single() ? 'large' : 'medium',
            'echo'           => true,
        ]);
        extract($args);
        if($echo) {
        ?>
        <div class="post-image biger-post"><?php biger_image_by_size($id = null,$thumbnail_size); ?></div>
        <?php do_action('biger_post_thumbnail_content'); ?>
        <?php
        } else {
            return '<div class="post-image biger-post" style="background-image: url('.biger_get_image_url_by_size($id = null,$thumbnail_size).');"><img src="'.biger_get_image_url_by_size($id = null,$thumbnail_size).'" alt="'.get_the_title().'" /></div>'.do_action('biger_post_thumbnail_content');
        }
    }
}

/**
 * Biger Post Gallery 
 * @since 1.0.1
*/
if(!function_exists('biger_post_gallery')){
    function biger_post_gallery($args=[]){
        $args = wp_parse_args($args, array(
            'id'             => null,
            'show_media'     => '1',
            'thumbnail_size' => 'large',
            'show_author'    => is_singular() ? biger_get_opts('archive_author_on','1') : biger_get_opts('post_author_on','1'),
            'echo'           => true
        ));
        if('0' === $args['show_media']) return;
        // Get gallery from option
        $gallery_list = explode(',', biger_get_post_format_value('post-gallery-images', []));
        // Get first gallery in content 
        $gallery_in_content = get_post_gallery( get_the_ID(), false );
        if($gallery_in_content && empty($gallery_list[0]) && !is_singular()){
            $gallery_list = isset($gallery_in_content['ids']) ? explode(',', $gallery_in_content['ids']) : [];
        }
        $light_box = biger_get_post_format_value('post-gallery-lightbox', '1');
        if(empty($light_box)) $light_box = '1';
        $gallery_classes = ['images-light-box'];
        if( !empty($gallery_list[0]) || has_post_thumbnail() ){
            if(!empty($gallery_list[0])){
                if($light_box === '0'){
                    $gallery_classes[] = 'oc-owl oc-carousel owl-carousel';
                    global $biger_owl;
                    wp_enqueue_script('vc_pageable_owl-carousel');
                    wp_enqueue_script('biger-owl');
                    wp_enqueue_style( 'vc_pageable_owl-carousel-css');
                    $gal_id = 'gal-'.get_the_ID();
                    $rtl = is_rtl() ? true : false;
                    $icon_prev = is_rtl() ? 'right' : 'left';
                    $icon_next = is_rtl() ? 'left' : 'right';
                    $nav_icon = array('<span class="fa fa-angle-'.$icon_prev.'" data-title="'.esc_attr__('Prev','biger').'"></span>','<span class="fa fa-angle-'.$icon_next.'" data-title="'.esc_attr__('Next','biger').'"></span>');

                    $biger_owl[$gal_id] = array(
                        'rtl'                => $rtl,
                        'margin'             => 0,
                        'loop'               => false,
                        'autoplay'           => true,
                        'autoplayTimeout'    => 2000,
                        'nav'                => true,
                        'navContainerClass'  => 'owl-nav nav-vertical inside',
                        'navText'            => $nav_icon,
                        'dots'               => false,
                        'autoHeight'         => true,
                        'responsiveClass'    => true,
                        'slideBy'            => 'page',
                        'responsive'         => array(
                            0 => array(
                                'items' => 1,
                            ),
                            
                        )
                    );
                    wp_localize_script('vc_pageable_owl-carousel', 'biger_owl', $biger_owl);
                }
            ?>
                <div id="gal-<?php echo get_the_ID();?>" class="<?php echo trim(implode(' ', $gallery_classes));?>">
                    <?php 
                    if($light_box === '1'){
                        $d = 0; 
                        foreach ($gallery_list as $img_id): 
                        $d++;
                    ?>
                        <a class="light-box" href="<?php echo esc_url(wp_get_attachment_image_url($img_id, 'full'));?>" title="<?php echo esc_attr(get_post_meta( $img_id, '_wp_attachment_image_alt', true )) ?>"><?php if($light_box === '1' && $d === 1) { ?><img src="<?php echo esc_url(wp_get_attachment_image_url($img_id, 'large'));?>" alt="<?php echo esc_attr(get_post_meta( $img_id, '_wp_attachment_image_alt', true )) ?>"><?php } ?></a>
                    <?php
                        endforeach; 
                    } else {
                        foreach ($gallery_list as $img_id): 
                    ?>
                        <a class="light-box" href="<?php echo esc_url(wp_get_attachment_image_url($img_id, 'full'));?>" title="<?php echo esc_attr(get_post_meta( $img_id, '_wp_attachment_image_alt', true )) ?>"><img src="<?php echo esc_url(wp_get_attachment_image_url($img_id, 'large'));?>" alt="<?php echo esc_attr(get_post_meta( $img_id, '_wp_attachment_image_alt', true )) ?>"></a>
                    <?php
                        endforeach; 
                    }
                    ?>
                </div>
            <?php 
                if($light_box === '0') biger_loading_animation();
            } elseif(has_post_thumbnail()) {
                biger_post_thumbnail($args);
            }
        }
    }
}
/**
 * Biger Post Video
 * @since 1.0.1
*/
if(!function_exists('biger_post_video')){
    function biger_post_video($args=[]){
        global $wp_embed;
        $args = wp_parse_args($args, [
            'id'             => null,
            'thumbnail_size' => is_single() ? 'large' : 'medium',
            'echo'           => true,
        ]);
        $video_url = biger_get_post_format_value('post-video-url', '');
        $video_file = biger_get_post_format_value('post-video-file', []);
            $video_file_id  = isset($video_file['id']) ? $video_file['id'] : '';
        $video_html = biger_get_post_format_value('post-video-html', '');

        // Only get video from the content if a playlist isn't present.
        $_video_in_content = apply_filters( 'the_content', get_the_content() );
        if ( false === strpos( $_video_in_content, 'wp-playlist-script' ) ) {
            $video_in_content = get_media_embedded_in_content( $_video_in_content, array( 'video', 'object', 'embed', 'iframe' ) );
        }

        $video = '';
        ob_start();
        if (!empty($video_url)) {
            $video = do_shortcode($wp_embed->autoembed($video_url));
        } elseif (!empty($video_file_id)) {
            /* Get default video poster */
            $poster = !empty(get_the_post_thumbnail_url($video_file_id)) ? get_the_post_thumbnail_url($video_file_id,'full') : get_the_post_thumbnail_url(get_the_ID(),'full');
            //attachment meta data 
            $att_data = wp_get_attachment_metadata($video_file_id);
            $mime_type = explode('/', $att_data['mime_type']);
            /* Build video */            
            $video_atts = array(
                'src'    => esc_url($video_file['url']),
                'poster' => esc_url($poster),
                'width'  => esc_attr($video_file['width']),
                'height' => esc_attr($video_file['height'])
            );
            switch ($mime_type[0]) {
                case 'audio':
                    $video = do_shortcode($wp_embed->autoembed($video_file['url']));
                    break;
                
                default:
                    if(!empty($poster))
                        $video = wp_video_shortcode($video_atts);
                    else 
                        $video = do_shortcode($wp_embed->autoembed($video_file['url']));
                    break;
            }            
        } elseif ('' != $video_html) {
            $_video_html = explode(',', $video_html);
            foreach ($_video_html as $value) {
                $video .= '<div class="video-item">'.do_shortcode($wp_embed->autoembed($value)).'</div>';
            }
        } elseif(! empty( $video_in_content ) && !is_singular()){
            // If not a single post, highlight the video file.
            foreach ( $video_in_content as $video_in_content_html ) {
                $video .= $video_in_content_html;
            }
        } else {
        	$video = biger_post_thumbnail($args);
        }
        $video .= ob_get_clean();
        // Show video 
        if($args['echo'])
            echo apply_filters('biger_post_video', $video);
        else 
            return $video;
    }
}

/**
 * Bigger Post Audio
 * @since 1.0.1
*/
if(!function_exists('biger_post_audio')){
    function biger_post_audio($args = []){
        $args = wp_parse_args($args, [
            'id'             => null,
            'thumbnail_size' => is_single() ? 'large' : 'medium',
            'echo'           => true,
        ]);
        global $wp_embed;
        $audio_url = biger_get_post_format_value('post-audio-url', '');
        $audio_file = biger_get_post_format_value('post-audio-file', ['id'=>'']);
        if(!empty($audio_file['id'])){
            /* Get default video poster */
            $poster = (is_array($audio_file) && !empty(get_the_post_thumbnail_url($audio_file['id']))) ? get_the_post_thumbnail_url($audio_file['id'],'full') : get_the_post_thumbnail_url(get_the_ID(),'full');
            //attachment meta data 
            $att_data = wp_get_attachment_metadata($audio_file['id']);
            $mime_type = explode('/', $att_data['mime_type']);
            /* Build audio */            
            $audio_atts = array(
                'src'    => esc_url($audio_file['url']),
                'poster' => esc_url($poster),
                'width'  => esc_attr($audio_file['width']),
                'height' => esc_attr($audio_file['height'])
            );
        }
        // get audion in content 
        $_audio_in_content = apply_filters( 'the_content', get_the_content() );
        // Only get audio from the content if a playlist isn't present.
        if ( false === strpos( $_audio_in_content, 'wp-playlist-script' ) ) {
            $audio_in_content = get_media_embedded_in_content( $_audio_in_content, array( 'audio' ) );
        }

        $audio = '';
        ob_start();
        if(!empty($audio_url)){
            $audio =  do_shortcode($wp_embed->autoembed($audio_url));
        } elseif (!empty($audio_file['id'])) {
            switch ($mime_type[0]) {
                case 'audio':
                    $audio = do_shortcode($wp_embed->autoembed($audio_file['url']));
                    break;
                case 'application':
                    $audio = do_shortcode($wp_embed->autoembed($audio_file['url']));
                    break;
                
                default:
                    if(!empty($poster)){
                        $audio = wp_video_shortcode($audio_atts);
                    } else {
                        $audio = do_shortcode($wp_embed->autoembed($audio_file['url']));
                    }
                    break;
            }            
        } elseif(! empty( $audio_in_content ) && !is_singular()){
            // If not a single post, highlight the audio file.
            foreach ( $audio_in_content as $audio_in_content_html ) {
                $audio .= $audio_in_content_html;
            }
        } elseif ( has_post_thumbnail() ){
            $audio = biger_post_thumbnail($args);
        }
        $audio .= ob_get_clean();
        // Show video 
        if($args['echo'])
            echo apply_filters('biger_post_audio', $audio);
        else 
            return $audio;
    }
}
/**
 * Bigger Post Audio
 * @since 1.0.1
*/
if(!function_exists('biger_post_quote')){
    function biger_post_quote($args = []){
        $args = wp_parse_args($args, [
            'id'             => null,
            'thumbnail_size' => is_single() ? 'large' : 'medium',
            'echo'           => true,
        ]);
        $text = biger_get_post_format_value('post-quote-text', '');
        $cite = biger_get_post_format_value('post-quote-cite', '');
        $quote = '';
        $quote_attrs = $quote_style = [];
        $quote_attrs[] = 'class="quote-wrap"';
        // Inline Style
        $bg_img = biger_get_image_url_by_size($args['id'],'post-thumbnail');
        if(!empty($bg_img)) {
            $quote_style[] = 'background-image:url('.$bg_img.')';
            $quote_style[] = 'color:#fff';
        }
        if(!empty($quote_style)) $quote_attrs[] = 'style="'.trim(implode(';', $quote_style)).'"'; 

        if(!empty($text) || !empty($cite))
            $quote = '<div '.trim(implode(' ', $quote_attrs)).'><div class="quote-text">'.$text.'</div><cite>'.$cite.'</cite></div>';
        else 
            $quote = biger_post_thumbnail($args);
        if($args['echo'])
            echo apply_filters('biger_post_quote', $quote);
        else 
            return $quote;
    }
}

/**
 * Biger Post Media
 * @since 1.0.1
*/
if(!function_exists('biger_post_media')){
    function biger_post_media($args = []){
        $args = wp_parse_args($args, [
            'id'             => null,
            'thumbnail_size' => is_single() ? 'large' : 'large',
            'echo'           => true,
        ]);
        do_action('biger_before_post_media');
        $post_format = !empty(get_post_format()) ? get_post_format() : 'standard';
    ?>
    <div class="entry-featured entry-<?php echo esc_attr($post_format);?>"><?php 
        switch (get_post_format()) {
            case 'gallery':
                biger_post_gallery($args);
                break;
            case 'video':
                biger_post_video($args);
                break;
            case 'audio':
                biger_post_audio($args);
                break;
            case 'quote':
                biger_post_quote($args);
                break;
            default:
                biger_post_thumbnail($args);
                break;
        }
        do_action('biger_post_media_content');
    ?></div><?php
    do_action('biger_after_post_media');
    }
}

if(!function_exists('biger_loop_media')){
    function biger_loop_media($args = []){
        $args = wp_parse_args($args, [
            'show_media'     => '1',
            'thumbnail_size' => 'large',
            'show_author'    => '1'
        ]);
        extract($args);
        if('1' !== $show_media) return;
        
        biger_post_media($args); 
    }
}

/**
 * Post Author's on Media 
 * @since 1.0.1
*/
if(!function_exists('biger_post_author_on_media')){
    add_action('biger_post_thumbnail_content','biger_post_author_on_media', 10);
    function biger_post_author_on_media($args = []){
        $args = wp_parse_args($args, [
            'echo' => true,
            'show_author' => is_singular() ? biger_get_opts('archive_author_on','1') : biger_get_opts('post_author_on','1')
        ]);
        extract($args);

        if('1' !== $show_author) return;
        $default_avatar = '';
        ob_start();
            echo '<div class="post-author">'
            .get_avatar(get_the_author_meta('ID'), 30,  $default_avatar , get_the_author(), array('class' => 'img-circle circle alignleft')).'&nbsp;&nbsp;'
            .esc_html__('By','biger').':&nbsp;'
            .get_the_author_posts_link()
            .'</div>';
        if($args['echo'])
            echo ob_get_clean();
        else 
            return ob_get_clean();
    }
}
    
asked by Jacobo Rodriguez 23.11.2018 в 21:45
source

0 answers