• Resolved Pbalazs89

    (@pbalazs89)


    Hi there, I have a shortcode on my site.
    The weird part is, it works for HU, IT, ES, PL, RO,

    but does not work for: UA, CA

    Here is the shortcode:

    function custom_shop_image_container(){
            $flag = get_field('country_of_origin');
            echo '<div class="inner-img">';
            
    
            // if ($flag != null) {
            //         echo $flag;
            // }
    
            if ($flag == "Magyarország") {
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="HU"]');
                    echo '</div>';
            } elseif ($flag == "Olasz"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="IT"]');
                    echo '</div>';
    
            } elseif ($flag == "Spanyol"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="ES"]');
                    echo '</div>';
    
            } elseif ($flag == "Lengyel"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="PL"]');
                    echo '</div>';
    
            }
            elseif ($flag == "Románia"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="RO"]');
                    echo '</div>';
    
            }
            elseif ($flag = "Amerika"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="US"]');
                    echo '</div>';
    
            }
            elseif ($flag = "Kanada"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="CA"]');
                    echo '</div>';
    
            }
            elseif ($flag == "Ukrajna"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="UA"]');
                    echo '</div>';
    
            }
            elseif ($flag == "Afrika"){
                    echo '<div class="country-flag">';
                    echo do_shortcode('[svg-flag flag="UA"]');
                    echo '</div>';
    
    Can you help with any ideas as to why this might be?
    
            }
    
            
            
            
        
    }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Some flags not working in shortcode?’ is closed to new replies.