Snippets

Language Dependent Float

When you need to build a theme that support in LTR but also in RTL you need small functions that makes life easier! This couple of function saved my a lot of time and weight on un-needed css code! Use it wisely yound jedi

function fright() {
    if(is_rtl()) {echo 'fright';} else {echo 'fleft';}
}

function fleft() {
    if(is_rtl()) {echo 'fleft';} else {echo 'fleft';}
}

Source: http://www.sagive.co.il/wordpress-snippets/...

Share this snippet

 

Comments (2) - Leave yours

  1. Sagive SEO said:

    Right you are… the css is also missing here (i did submit it :( ) i hope the code would display here.

    function fright() {
    if(is_rtl()) {echo ‘fright’;} else {echo ‘fleft’;}
    }

    function fleft() {
    if(is_rtl()) {echo ‘fleft’;} else {echo ‘fright’;}
    }

    // CSS:
    .fright {float: right !important;}
    .fleft {float: left !important;}

Leave a Reply

Your email address will not be published. Required fields are marked *

Please respect the following rules: No advertising, no spam, no keyword in name field. Thank you!