【问题标题】:WAMP: attauching stylesheet to a web page on wordpressWAMP:将样式表附加到 wordpress 上的网页
【发布时间】:2016-03-31 00:57:12
【问题描述】:

the chrome dev tools - output from the conlost 我是 wordpress 的新手,我正在尝试附加到主题主样式表,但是我有问题,样式规则不适用于页面。到目前为止,这是我的 index.php 文件:

<?php
    get_header();
    if (have_posts()):
        while (have_posts()):
            the_post();
        the_title();
        the_excerpt();
        the_author();
        endwhile;
    endif;
    get_sidebar();
    get_footer();

?> 这是我用于上传样式表的 functions.php 文件:

<?php
function add_theme_scripts() {
    wp_enqueue_style( 'main', get_stylesheet_uri(), false );
}
add_action("wp_enqueue_scripts", "add_theme_scripts");
?>

但是我尝试通过头文件头部的blogifno上传样式,但它也不起作用,页面显示根本没有样式这是怎么回事? css 文件位于根文件夹中,没有任何子文件夹

【问题讨论】:

    标签: css wordpress


    【解决方案1】:

    Style.css 应该在主题文件夹中,例如:wp-content/themes/your_theme/style.css。 也许这会有所帮助:Wordpress default stylesheet path

    【讨论】:

    • 它一直在那里,在主题文件夹中,在你一直提到的默认路径上
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-24
    • 1970-01-01
    • 2010-10-12
    • 1970-01-01
    相关资源
    最近更新 更多