• Resolved jaworowicz

    (@jaworowicz)


    How create IF PHP code ?
    like WPML?

    <?php if ( is_front_page() && ICL_LANGUAGE_CODE=='it' ) : ?>
     
    <?php putRevSlider("home-due") ?>
     
    <?php endif; ?>
     
    <?php if ( is_front_page() && ICL_LANGUAGE_CODE=='fr' ) : ?>
     
    <?php putRevSlider("home-fr") ?>
     
    <?php endif; ?>
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jaworowicz

    (@jaworowicz)

    Ok, problem solved.

    if ( wpm_get_language() == 'pl' ) {
    echo 'PL';
    }
    
    if ( wpm_get_language() == 'en' ) {
    echo 'EN';
    }
    
    if ( wpm_get_language() == 'de' ) {
    echo 'DE';
    }

    Hi @jaworowicz,
    Just curious… Why and where do you use this code?
    Any special hint? Do you have to use this code with Rev Slider to make it use a specific page based on a specific language?

    Thank you for your input.

    Thread Starter jaworowicz

    (@jaworowicz)

    Replace echo 'pl' by function with revslider shortode / or anything you need.

    if ( wpm_get_language() == 'pl' ) { 
    putRevSlider("slider-pl")
    } 
    if ( wpm_get_language() == 'en' ) 
    { 
    putRevSlider("slider-en")
    } 
    if ( wpm_get_language() == 'de' ) { 
    putRevSlider("slider-de")
    }

    Where: template or custom template file eg. page-home.php

    I had to load different things and scripts depending on the language – actually in WPML I often use the code from the first post – that’s why I was looking for a similar solution for your plugin.

    it can be anything including activating or deactivating actions and filters ?? and not just adding content or slider.

    • This reply was modified 7 years, 1 month ago by jaworowicz.
    • This reply was modified 7 years, 1 month ago by jaworowicz.
    • This reply was modified 7 years, 1 month ago by jaworowicz.
    • This reply was modified 7 years, 1 month ago by jaworowicz.

    Hey Thank You @jaworowicz
    Bookmarked for further use.
    Thank you for your contribution and time.
    Have a great weekend!!!

    thanks @jaworowicz, this helped me too. Just curious, how did you find out the name of the function? Is there documentation somewhere?

    Thread Starter jaworowicz

    (@jaworowicz)

    No.
    Experimet after analyse The plug-in Code ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP IF’ is closed to new replies.