I’ve tried just about every other plugin out there, free and premium. Transposh is the best, bar none. תודה, עופר, for keeping it alive. Good to read you’re ok. It’s a relief to have something good be shared, especially in these difficult and violent times. Feels like a spark of hope for humanity. So here is my little pebble.
As opposed to the [tpe lang="ב" רק ="y"] אוֹ [tpe mylang lang='fr,en'] shortcode methods, which don’t always work, here is the best, easiest, and most powerful way to show content selectively per language:
//add a class to body based on the language function custom_body_class($שיעורים) {
// Check if the URL contains ‘/en/’
אם (strpos($_שרת['REQUEST_URI'], ‘/en/’) !== false) {
// Add ‘english’ to the body class array
$שיעורים[] = ‘english’;
} אַחֵר {
// Add ‘french’ to the body class array if ‘/en/’ is not found
$שיעורים[] = ‘french’;
} return $classes;
}
add_filter(‘body_class’, ‘custom_body_class’);
3. Add this CSS:
/*hide french listing on english pages*/ body.english .not-on-french { display: אף אחד;
}
/*hide english listing on french pages*/ body.french .not-on-english { display: אף אחד;
}
4. אז, to show an element selectively, all you have to do is add one of these this classes to the elements you want to hide:
“not-on-english”
אוֹ
“not-on-french”
Long live Transposh and may humans continue understanding each other !
עופר היי & טרנספוש,
יום הולדת שמח לטרנספוש!
תודה שהצעת את זה בחינם, נהדר plugin. זה באמת עזר לאתר שלי לצמוח ולהרחיב את הקהל להגיע.
תודה רבה לך!!
Thank you for your kind words
תוסף מעולה, didn’t expect there to be an update.
Thank you for your generosity and free, some of the features of your plugin are better compared to other paid plugins.
I’ve tried just about every other plugin out there, free and premium. Transposh is the best, bar none. תודה, עופר, for keeping it alive. Good to read you’re ok. It’s a relief to have something good be shared, especially in these difficult and violent times. Feels like a spark of hope for humanity. So here is my little pebble.
As opposed to the [tpe lang="ב" רק ="y"] אוֹ [tpe mylang lang='fr,en'] shortcode methods, which don’t always work, here is the best, easiest, and most powerful way to show content selectively per language:
1. טרנספוש > הגדרות > general settings > tick rewrite urls (לְשֶׁעָבַר (http://transposh/en))
2. Add this to your functions.php:
//add a class to body based on the language
function custom_body_class($שיעורים) {
// Check if the URL contains ‘/en/’
אם (strpos($_שרת['REQUEST_URI'], ‘/en/’) !== false) {
// Add ‘english’ to the body class array
$שיעורים[] = ‘english’;
} אַחֵר {
// Add ‘french’ to the body class array if ‘/en/’ is not found
$שיעורים[] = ‘french’;
}
return $classes;
}
add_filter(‘body_class’, ‘custom_body_class’);
3. Add this CSS:
/*hide french listing on english pages*/
body.english .not-on-french {
display: אף אחד;
}
/*hide english listing on french pages*/
body.french .not-on-english {
display: אף אחד;
}
4. אז, to show an element selectively, all you have to do is add one of these this classes to the elements you want to hide:
“not-on-english”
אוֹ
“not-on-french”
Long live Transposh and may humans continue understanding each other !