Replace Import Thumbmail

Closed

Import WP Updated 1 year ago 1 Reply

Jens asked 1 year ago on January 2, 2023 at 11:13 am

Hi, i need an if/else Code to change thumbnail Import.

IF the Import URL is “https://xxx.com/image01.png” it should be Imported as “https://yyy.com/image0007.png”

 

Can you help me please.

J

James replied Support Agent

1 year ago on January 3, 2023 at 11:09 pm

Hi Jens,

You can create a custom function using php that can be used in the importer, An example if statement can be used by adding this code to your website

<?php
function iwp_if($if_this = '', $equals_this = '', $output_this = '')
{

    if ($if_this == $equals_this) {
        return $output_this;
    }

    return $if_this;
}

To use this, in your importer template field instead of the value selector "{10}",  you would replace it with [iwp_if("{10}","https://xxx.com/image01.png", "https://yyy.com/image0007.png")]