-
AuthorPosts
-
May 26, 2015 at 11:43 pm #450348
I use Enfold child theme on a Hebrew website.
I want to add 5 pages in English, and didn’t find a simple plugin for this so I have a few question on that:
- How can I have a different url for the logo image for these 5 pages. Ex. http://www.mysite.com/en instead of http://www.mysite.com in only 5 pages?
- How can I tell the page not to use the rtl.css and the mo and po files in these 5 page?
- How can I tell the page not to use the some of the functions on the function.php file? for ex. a fix which is for Hebrew but shouldn’t apply for English.
May 27, 2015 at 10:04 pm #450820I’ll be glad to get a solution even to one of these problem if possible. Many Thanks…
May 27, 2015 at 10:44 pm #450830I managed to find an answer for the first question about having different logo link here: https://kriesi.at/support/topic/custom-link-for-logo/
I used a code you once wrote here with the one on that link added it to functions.php and it works great:
add_filter(‘avf_logo_link’,’av_change_logo_link’);
function av_change_logo_link($link)
{
if(is_page( array(1,2,3,4,5) ))
{
$link = “http://www.mysite.com/en/”;
}return $link;
}Now 2 problems remain unsolved:
1. How can I tell the page not to use the rtl.css and the mo and po files in these 5 page? or any other way to have english text for search bar and search results on a hebrew page.
2. How can I tell the page not to use some of the functions on the function.php file? for ex. a fix which is for Hebrew but shouldn’t apply for English. or any other way to have the page columns align from left to right on english pages when on hebrew pages it works well – aligning from right to left.May 28, 2015 at 5:56 am #450894Hi!
1. Not sure if that’s possible, it would depend on the language set in the site but you can directly edit the .mo/.po files using PoEdit or similar.
2. Same as the code for the logo you can explicitly enqueue the RTL stylesheet:
add_action('wp_enqueue_scripts', function() { if(is_page(2)){ $template_url = get_template_directory_uri(); wp_enqueue_style( 'avia-rtl', $template_url."/css/rtl.css", array(), '1', 'all' ); } });
Best regards,
JosueMay 28, 2015 at 1:05 pm #451159Hi,
Not sure I understand how to do this…
Here’s an example of a function I added to functions.php to fix a problem in Hebrew which I want to skip on 5 page in which are in English:
—————————–
function rtl_columns_fix(){
?>
<script>
(function($){var resizeTimeout, sortedReverse = false;
$(window).resize(function () {
if (resizeTimeout) {
window.clearTimeout(resizeTimeout);
}
resizeTimeout = window.setTimeout(function () {
var windowWidth = window.innerWidth;
if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) {var rtlContainer = $(‘.entry-content-wrapper, #footer .container’);
rtlContainer.each(function(){
var rtlCols = $(this).children(‘.flex_column’).not(‘.av_one_full’);
$(this).append(rtlCols.get().reverse());
});sortedReverse = !sortedReverse;
}
}, 100);
}).trigger(“resize”);})(jQuery);
</script>
<?php
}
—————————–
If the pages’ id are for ex. 1,2,3,4,5 what should I write to skip this function on these pages?Many Thanks
May 28, 2015 at 8:17 pm #451418Hi!
Try with the following:
function rtl_columns_fix(){ if(is_page(array(32,3,4,5))){ ?> <script> (function($){ var resizeTimeout, sortedReverse = false; $(window).resize(function () { if (resizeTimeout) { window.clearTimeout(resizeTimeout); } resizeTimeout = window.setTimeout(function () { var windowWidth = window.innerWidth; if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) { var rtlContainer = $(‘.entry-content-wrapper, #footer .container’); rtlContainer.each(function(){ var rtlCols = $(this).children(‘.flex_column’).not(‘.av_one_full’); $(this).append(rtlCols.get().reverse()); }); sortedReverse = !sortedReverse; } }, 100); }).trigger(“resize”); })(jQuery); </script> <?php } }
Regards,
JosueMay 29, 2015 at 5:08 pm #451707It makes all the pages align like English pages (which is the default – that’s what would be if I remove the code all together).
I want this code to apply to all my website, which is in Hebrew, except the 5 English pages which should act like the default.
Any idea what to change. This is the code I added to functions.php but didn’t didn’t work:
function rtl_columns_fix(){
if(is_page( array(5289,5298,5300,5302,5304) ))
{
?>
<script>
(function($){var resizeTimeout, sortedReverse = false;
$(window).resize(function () {
if (resizeTimeout) {
window.clearTimeout(resizeTimeout);
}
resizeTimeout = window.setTimeout(function () {
var windowWidth = window.innerWidth;
if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) {var rtlContainer = $(‘.entry-content-wrapper, #footer .container’);
rtlContainer.each(function(){
var rtlCols = $(this).children(‘.flex_column’).not(‘.av_one_full’);
$(this).append(rtlCols.get().reverse());
});sortedReverse = !sortedReverse;
}
}, 100);
}).trigger(“resize”);})(jQuery);
</script>
<?php
}
}May 30, 2015 at 2:37 am #451855Hey!
You can prefix “!” to a function to do the opposite:
if(!is_page( array(5289,5298,5300,5302,5304) )) ... }
Regards,
JosueMay 30, 2015 at 2:49 am #451858it still makes the all website align like in english and not just the 5 pages. any ideas?
function rtl_columns_fix(){
if(!is_page( array(5289,5298,5300,5302,5304) ))
{
?>
<script>
(function($){var resizeTimeout, sortedReverse = false;
$(window).resize(function () {
if (resizeTimeout) {
window.clearTimeout(resizeTimeout);
}
resizeTimeout = window.setTimeout(function () {
var windowWidth = window.innerWidth;
if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) {var rtlContainer = $(‘.entry-content-wrapper, #footer .container’);
rtlContainer.each(function(){
var rtlCols = $(this).children(‘.flex_column’).not(‘.av_one_full’);
$(this).append(rtlCols.get().reverse());
});sortedReverse = !sortedReverse;
}
}, 100);
}).trigger(“resize”);})(jQuery);
</script>
<?php
}
}
if(is_rtl()) {
add_action(‘wp_footer’, ‘rtl_columns_fix’);
}May 30, 2015 at 3:03 am #451859Tried again with this code and it works great. Thank you so much!!!
function rtl_columns_fix(){
if(!is_page( array(5289,5298,5300,5302,5304) ))
{
?>
<script>
(function($){var resizeTimeout, sortedReverse = false;
$(window).resize(function () {
if (resizeTimeout) {
window.clearTimeout(resizeTimeout);
}
resizeTimeout = window.setTimeout(function () {
var windowWidth = window.innerWidth;
if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) {var rtlContainer = $(‘.entry-content-wrapper, #footer .container’);
rtlContainer.each(function(){
var rtlCols = $(this).children(‘.flex_column’).not(‘.av_one_full’);
$(this).append(rtlCols.get().reverse());
});sortedReverse = !sortedReverse;
}
}, 100);
}).trigger(“resize”);})(jQuery);
</script>
<?php
}
}
if(is_rtl()) {
add_action(‘wp_footer’, ‘rtl_columns_fix’);
} -
AuthorPosts
- The topic ‘English pages on Hebrew website’ is closed to new replies.