Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #745176

    Hi

    I added an image in my header and have used a code snippet that I’ve added to my Child theme functions.php that I found in the ticket. It appears to work well, however the code is generating the following errors in my log.

    [Fri Feb 10 00:00:56.304897 2017] [:error] [pid 31887] [client 75.156.21.149:52353] PHP Warning: Missing argument 2 for avia_woocommerce_parallax_banner_child_theme() in /nas/content/live/silviafindings/wp-content/themes/enfold-child/functions.php on line 57, referer: http://silviafindings.wpengine.com/product-category/wire/sterling-silver-wires/half-round-wires/half-hard-half-round-wires (hosted on WPengine)

    [Fri Feb 10 00:00:56.304975 2017] [:error] [pid 31887] [client 75.156.21.149:52353] PHP Warning: Missing argument 3 for avia_woocommerce_parallax_banner_child_theme() in /nas/content/live/silviafindings/wp-content/themes/enfold-child/functions.php on line 57, referer: http://silviafindings.wpengine.com/product-category/wire/sterling-silver-wires/half-round-wires/half-hard-half-round-wires

    [Fri Feb 10 00:00:56.304989 2017] [:error] [pid 31887] [client 75.156.21.149:52353] PHP Warning: Missing argument 4 for avia_woocommerce_parallax_banner_child_theme() in /nas/content/live/silviafindings/wp-content/themes/enfold-child/functions.php on line 57, referer: http://silviafindings.wpengine.com/product-category/wire/sterling-silver-wires/half-round-wires/half-hard-half-round-wires

    [Fri Feb 10 00:00:56.304999 2017] [:error] [pid 31887] [client 75.156.21.149:52353] PHP Warning: Missing argument 5 for avia_woocommerce_parallax_banner_child_theme() in /nas/content/live/silviafindings/wp-content/themes/enfold-child/functions.php on line 57, referer: http://silviafindings.wpengine.com/product-category/wire/sterling-silver-wires/half-round-wires/half-hard-half-round-wires

    Here’s the code snippet I copied:

    //Add a widget area to the header
    add_action( ‘ava_main_header’, ‘enfold_customization_header_widget_area’ );
    function enfold_customization_header_widget_area() {
    dynamic_sidebar( ‘header’ );
    }

    // Fix Enfold from using 1500px wide image and use the full-size image instead
    add_action( ‘init’, ‘ssi_woocommerce_full_width_category_images’, 50 );
    function ssi_woocommerce_full_width_category_images()
    {
    remove_action( ‘ava_after_main_container’, ‘avia_woocommerce_shop_banner’, 11 );
    add_action( ‘ava_after_main_container’, ‘avia_woocommerce_parallax_banner_child_theme’, 11);

    function avia_woocommerce_parallax_banner_child_theme($bg, $overlay, $opacity, $description, $font)
    {

    if(is_numeric($bg))
    {
    $bg = wp_get_attachment_image_src($bg, ‘full’);
    if(is_array($bg) && $bg[0] != “”) $bg = $bg[0];
    }

    if($font) $font = “style=’color:{$font};'”;
    if($bg) $bg = “background-image: url(“.$bg.”);”;

    $output = “”;

    $output .='<div id=”av_product_description” class=”avia-section main_color avia-section-large avia-no-border-styling avia-full-stretch av-parallax-section av-section-color-overlay-active avia-bg-style-parallax container_wrap fullsize” data-section-bg-repeat=”stretch” ‘.$font.’>’;
    $output .='<div class=”av-parallax avia-full-stretch” data-avia-parallax-ratio=”0.3″>’;
    $output .='<div class=”av-parallax-inner” style=”‘.$bg.’ main_color background-attachment: scroll; background-position: 50% 50%; background-repeat: no-repeat;”>’;
    $output .='</div>’;
    $output .='</div>’;

    $output .='<div class=”av-section-color-overlay-wrap”>’;
    if(!empty($overlay))
    {
    $output .='<div class=”av-section-color-overlay” style=”opacity: ‘.$opacity.’; background-color: ‘.$overlay.’; “></div>’;
    }

    $output .='<div class=”container”>’;
    $output .='<main class=”template-page content av-content-full alpha units”>’;
    if($description) $output .= “<h1>”.$description.”</h1>”;
    $output .='</main></div></div></div>’;

    return $output;
    }

    remove_action( ‘ava_after_main_container’, ‘avia_woocommerce_big_cat_banner’, 11 );
    add_action( ‘ava_after_main_container’, ‘avia_woocommerce_big_cat_banner_child_theme’, 11 );

    function avia_woocommerce_big_cat_banner_child_theme()
    {
    if(is_product_category())
    {
    global $wp_query, $avia_config;

    if(isset($wp_query->query_vars[‘taxonomy’]))
    {
    $term = get_term_by( ‘slug’, get_query_var($wp_query->query_vars[‘taxonomy’]), $wp_query->query_vars[‘taxonomy’]);
    if(!empty($term->term_id))
    {
    $description = term_description() ;
    $style = get_woocommerce_term_meta($term->term_id, ‘av_cat_styling’);
    $attachment_id = get_woocommerce_term_meta($term->term_id, ‘thumbnail_id’);

    $overlay = get_woocommerce_term_meta($term->term_id, ‘av-banner-overlay’);
    $font = get_woocommerce_term_meta($term->term_id, ‘av-banner-font’);
    $opacity = get_woocommerce_term_meta($term->term_id, ‘av-banner-overlay-opacity’);

    if(!empty($style))
    {
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_taxonomy_archive_description’, 11 );
    echo avia_woocommerce_parallax_banner_child_theme($attachment_id, $overlay, $opacity, $description, $font);
    $avia_config[‘woo-banner’] = true;
    }
    }
    }
    }
    }
    }

    Can you help me find the culprit that is generating the errors please.

    To view the website you will need access credentials, so I added these to the private area.

    Thank You
    Lyse

    #746951

    Hey tremblayly,

    your first code should not cause any issues, but what are you using your second code for? If you want to change image sizes, then better to use a plugin like https://wordpress.org/plugins/simple-image-sizes/

    You could also ask WooCommerce support how to change their image sizes.

    Best regards,
    Andy

    #746979

    Hi Andy,

    I found the code in one of the tickets here and it allows the background image to be sized bigger than the restricted 1500px. Therefore it gets to stretch the whole width. Perhaps there’s a better way to do this within the text widget?

    I tried to find the ticket again but could not.

    Thanks
    Lyse

    #746993

    Hi Andy,

    My mistake, the second code snippet relates to the product category description area. So the errors generated from this relate to this.

    Here’s the ticket link: https://kriesi.at/support/topic/product-category-pages-full-width-page-banner-and-description/#post-559611

    Thanks
    Lyse

    #748448

    Hi,

    I don’t think you need this code. Where can we see the image in question? please provide a precise link. Did you try the plugin I recommended to you? A mockup showing the results you want would really help us.

    Best regards,
    Andy

    #748510

    Hi Andy,

    The website link was provided when I open the ticket. The image is on the header background on every page and is how I want it.
    Website URL: https://silviafindings.wpengine.com/

    When you mentioned that I did not need the code, I commented out the code snippet in my functions.php in my child theme and see the header background image just fine and I don’t get the errors any longer. That’s great.

    Thank you for you help
    Lyse

    #749340

    Hi,

    Glad we could help!
    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Thank you for using Enfold :)

    Best regards,
    Andy

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Image in Header’ is closed to new replies.