Skip to content

Instantly share code, notes, and snippets.

@trueqap
Created November 2, 2020 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trueqap/3a2e8476322c78fdfa5d16b3e41d4b62 to your computer and use it in GitHub Desktop.
Save trueqap/3a2e8476322c78fdfa5d16b3e41d4b62 to your computer and use it in GitHub Desktop.
Nyelv + CSS
<?php
$current_lang = apply_filters('wpml_current_language', NULL);
function lang_en() {
wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/en.css' );
}
function lang_it() {
wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/it.css' );
}
function lang_hu() {
wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/hu.css' );
}
if ('en' == $current_lang) {
add_action( 'wp_enqueue_scripts', 'lang_en' );
}
if ('it' == $current_lang) {
add_action( 'wp_enqueue_scripts', 'lang_it' );
}
if ('hu' == $current_lang) {
add_action( 'wp_enqueue_scripts', 'lang_hu' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment