Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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:

    1. 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?
    2. How can I tell the page not to use the rtl.css and the mo and po files in these 5 page?
    3. 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.
    #450820

    I’ll be glad to get a solution even to one of these problem if possible. Many Thanks…

    #450830

    I 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.

    #450894

    Hi!

    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,
    Josue

    #451159

    Hi,

    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

    #451418

    Hi!

    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,
    Josue

    #451707

    It 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
    }
    }

    #451855

    Hey!

    You can prefix “!” to a function to do the opposite:

    if(!is_page( array(5289,5298,5300,5302,5304) ))
    ...
    }

    Regards,
    Josue

    #451858

    it 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’);
    }

    #451859

    Tried 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’);
    }

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘English pages on Hebrew website’ is closed to new replies.