skip to Main Content

I’m using the polylang plugin. Additional css is required for the arabic language. How can I run css according to the subfolder in the functions?
example:

//This is your own css file
<link rel="stylesheet" href="/yellow.css" type="text/css" media="screen,projection" />
//this is the code that will also work according to subfolders
<?php if( url(www.example.com/ar) ) ?>
<link rel="stylesheet" href="/blue.css" type="text/css" media="screen"  />
<?php endif;?>

2

Answers


  1. If your trying to fetch styles for a page in php.
    Try this

    <!--Styles included -->
    <style>
    <?php include '/blue.css'?>
    </style>
    
    
    Login or Signup to reply.
  2. wp_enqueue_style('theme', PLUGIN_URL . '/assets/css/test.css');
    

    Another

     function load_admin_script() { 
          wp_enqueue_style('theme', DSSLIDER_PATH . 'assets/css/test.css'); 
    }  
    add_action( 'admin_enqueue_scripts', 'load_admin_script' );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search