使用WordPress子文件夹的自定义CSS?

发布于 2025-02-14 01:31:28 字数 413 浏览 4 评论 0原文

我正在使用Polylang插件。阿拉伯语需要其他CSS。如何根据功能中的子文件夹运行CSS? 例子:

//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;?>

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;?>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天气好吗我好吗 2025-02-21 01:31:28

如果您想在PHP中获取页面的样式。
尝试一下

<!--Styles included -->
<style>
<?php include '/blue.css'?>
</style>

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

<!--Styles included -->
<style>
<?php include '/blue.css'?>
</style>

霓裳挽歌倾城醉 2025-02-21 01:31:28
wp_enqueue_style('theme', PLUGIN_URL . '/assets/css/test.css');

其他

 function load_admin_script() { 
      wp_enqueue_style('theme', DSSLIDER_PATH . 'assets/css/test.css'); 
}  
add_action( 'admin_enqueue_scripts', 'load_admin_script' );
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' );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文