• Resolved itsmir

    (@itsmir)


    Hi all,

    I’m a php novice and am trying to call a php snippet dependent on the page language.

    The code I’m using in a php widget is:

    <?php if( $q_config['language'] == 'en' ): ?>
        <?php echo yksemeProcessSnippet( "1cbe28adbd" , "Submit" ); ?>
    <?php endif; ?>
    
    <?php if( $q_config['language'] == 'nl' ): ?>
        <?php echo yksemeProcessSnippet( "77685dc26e" , "Submit" ); ?>
    <?php endif; ?>

    ….and it doesn’t work. The widget area is blank.

    When I use the string on it’s own
    (e.g. <?php echo yksemeProcessSnippet( "1cbe28adbd" , "Submit" ); ?> )

    it shows correctly, so I know that the snippet is correct.

    I’m obviously doing something horrible wrong – can someone put me right please??

    Many thanks!!

    https://wordpress.org/plugins/qtranslate-x/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter itsmir

    (@itsmir)

    Fixed it!!

    I was trying too hard, all I needed to do was:-

    [:nl]<?php echo yksemeProcessSnippet( "77685dc26e" , "Submit" ); ?>
    [:en]<?php echo yksemeProcessSnippet( "1cbe28adbd" , "Submit" ); ?>

    🙂

    Plugin Author Gunu

    (@grafcom)

    @itsmir – Miriam 🙂

    thanks for the update – heb een fijne avond!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Call php string on page lang – I'm struggling!’ is closed to new replies.