Join our new community forum for support & discussion

Join Now

Home Support Themes ListingHive change the css based on language

change the css based on language

  • Author
    Posts
  • Laithtag

    Hey,

    i just made a code that can change the CSS based on the site if it’s rtl to ltr, I want to share it with you, if there is something to improve let me know,, and the code works fine.

    add_action( 'wp_enqueue_scripts', 'rtlcss' );
    function rtlcss(){
        if( is_rtl() ){
            echo '<style>
                .page__title {
                           text-align: right!important;
                      }	
                 .hp-menu--site-header .hp-menu__item {margin-left:0!important;margin-right:2rem}
                
            </style>';
        }
    }
    Laithtag

    the css i am using here to edit the nav bar, u can use whatever you want

    ihor developer

    Thanks for sharing 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.