Okay
  Public Ticket #847909
Payment logo's weird path
Closed

Comments

  • Caroline started the conversation

    Hi there,

    I'm having some trouble with the payment images in the footer. Whenever I try to upload one, the image is broken. This is due to a weird structure of the path as far as I can see. It adds like 'data/sites/website' in between the link; it does that no where else.

    PS: I inserted the wrong related link, this is the right one: 
    http://prettysweetsunniescom.webhosting.be

  • [deleted] replied

    Hi Caroline,

    The URL that you provided to us is not working.

  • [deleted] replied

    Hi Caroline,

    It seems that your images path is not right there.

    http://prettysweetsunniescom.webhosting.be/wp/data/sites/web/prettysweetsunniescom/website/web/app/uploads/2016/07/paypal_11-1.png
    

    Please check it again.

    If you still can't solve the problem, can you please send us your WordPress username and password? We need to investigate your site and then get back to you if we have possible solution.


    Make sure to choose Private Reply when you send us sensitive informations!

  •   Caroline replied privately
  • [deleted] replied

    Hi Caroline,

    After adding this code in functions.php it fixed the issue:

    // Fix Supported Payments SRC
    function fix_supported_payments_img_src( $url ) {
    return str_replace( 'data/sites/web/prettysweetsunniescom/website/web', '', $url );
    }

    function fix_supported_payments_img_src_key_value( $value, $key = '' ) {
    if ( is_array( $value ) ) {
    foreach ( $value as & $val ) {
    $val = str_replace( 'data/sites/web/prettysweetsunniescom/website/web/', '', $val );
    }
    }

    return $value;
    }

    add_filter( 'laborator_data_opt_image_src', 'fix_supported_payments_img_src' );
    add_filter( 'laborator_data_opt_entry_key_value', 'fix_supported_payments_img_src_key_value', 10, 2 );

    When you apply new update, please add the above code to functions.php (end of the file).