2. 將其添加到您的functions.php:
//add a class to body based on the language
function custom_body_class($classes) {
// Check if the URL contains '/en/'
if (strpos($_SERVER['REQUEST_URI'], '/en/') !== false) {
// Add 'english' to the body class array
$classes[] = 'english';
} else {
// Add 'french' to the body class array if '/en/' is not found
$classes[] = 'french';
}
return $classes;
}
add_filter('body_class', 'custom_body_class');
3. 添加此CSS:
/*hide french listing on english pages*/
body.english .not-on-french {
display: none;
}
/*hide english listing on french pages*/
body.french .not-on-english {
display: none;
}
4. 接著, 選擇性地顯示一個元素, 您所要做的就是將其中一個類別添加到要隱藏的元素中:
"not-on-english"
or
"not-on-french"
Hi and happy birthday! Next sunday will be mine … would you mind to tell me if Neve theme is compatible with Transposh? Your plugin has been suggested by my fab hosting Thank you!
乾杯 Antonella
After installing the latest version, the language buttons on the “語言” tab stay empty. No flags, language text. I de-installed and re-installed, to no avail.
I still had a 1.0.9.3 version and installed that. That works fine!
The best way would be a bug report on github, or sending a direct message to support via the contact us form,
There were changes in the language buttons, but they should load (and are probably loaded for almost everyone). have you tried using a different browser?
您好優惠 & 通過Transposh,
生日快樂!
謝謝您免費提供此信息, 很棒的插件. 它確實幫助我的網站增長並擴大了觀眾的影響.
非常感謝!!
謝謝你的客氣話
很棒的插件, 沒想到會有更新.
謝謝您的慷慨和自由, 與其他付費插件相比,插件的某些功能更好.
我幾乎嘗試了其他所有插件, 免費和高級. Transposh是最好的, 沒有什麼. 謝謝, 奧弗, 以保持它的活力. 很好看你還可以. 分享好東西是一種解脫, 特別是在這些艱難而暴力的時期. 感覺像是對人類的希望. 所以這是我的小卵石.
與 [tpe lang ="在" 僅 ="是"] 要么 [tpe mylang lang='fr,en'] 短代碼方法, 並不總是有效, 這是最好的, 最簡單, 以及最有力地顯示每個語言內容的內容的方法:
1. 通過Transposh > 設置 > 一般設置 > tick重寫URL (前任 (http://transposh/en))
2. 將其添加到您的functions.php:
//add a class to body based on the language
function custom_body_class($classes) {
// Check if the URL contains '/en/'
if (strpos($_SERVER['REQUEST_URI'], '/en/') !== false) {
// Add 'english' to the body class array
$classes[] = 'english';
} else {
// Add 'french' to the body class array if '/en/' is not found
$classes[] = 'french';
}
return $classes;
}
add_filter('body_class', 'custom_body_class');
3. 添加此CSS:
/*hide french listing on english pages*/
body.english .not-on-french {
display: none;
}
/*hide english listing on french pages*/
body.french .not-on-english {
display: none;
}
4. 接著, 選擇性地顯示一個元素, 您所要做的就是將其中一個類別添加到要隱藏的元素中:
"not-on-english"
or
"not-on-french"
千載難逢的轉移和願人類繼續互相理解 !
Hi and happy birthday!
Next sunday will be mine …
would you mind to tell me if Neve theme is compatible with Transposh?
Your plugin has been suggested by my fab hosting Thank you!
乾杯
Antonella
謝謝, and a happy birthday to you,
About Neve, I don’t know, I can only suggest trying, worst case – uninstall our plugin.
好運
After installing the latest version, the language buttons on the “語言” tab stay empty. No flags, language text.
I de-installed and re-installed, to no avail.
I still had a 1.0.9.3 version and installed that. That works fine!
Am I the only one?
kr,
Anton
你好,
The best way would be a bug report on github, or sending a direct message to support via the contact us form,
There were changes in the language buttons, but they should load (and are probably loaded for almost everyone). have you tried using a different browser?