我是wordpress的新手。是否必须向wordpress添加自定义css?
我们可以改变它的style.css吗?
答案 0 :(得分:0)
不是没有必要创建自定义CSS文件但是不使用核心主题CSS插件更好。
要在wordpress中添加自定义CSS,请将以下cod添加到theme / theme-name / functions.php文件中:
function hook_css()
{
wp_enqueue_style( 'unique-css-name', 'your-css-path/style.css' ); // includes CSS file
}
add_action('wp_head','hook_css'); // calls hook_css in head block
由于您是WordPress的新手,您必须知道wp_head是一个在head标签中自动调用的钩子
答案 1 :(得分:0)
绝对不需要添加自定义CSS。
要添加自定义CSS,您必须使用以下代码将自定义CSS文件包含在主题文件夹的header.php中:
<link href="<?php bloginfo('template_url'); ?>/file-name.css" rel="stylesheet" type="text/css">