use*_*096 3 css wordpress styles header stylesheet
我的 WordPress 有问题,我已经创建了所有需要的文件,包括 style.css index.php 等,但页面没有样式。在标题中,除其他外,我把这个
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="text/css" href="<?php bloginfo('template_url'); ?>/css/style.css" />
小智 5
就我而言,我没有链接 CSS。所以我通过执行以下操作解决了这个问题:
    <!DOCTYPE html>
    <html>
      <head>
        <?php wp_head(); ?>
      </head>
      <body>
        <h1>Wordpress</h1>
      </body>
    </html>之后,我必须在主题文件夹中创建另一个名为functions.php的新文件,并使用以下代码在该文件中链接style.css 。
<?php
function files() {
  wp_enqueue_style( 'style', get_stylesheet_uri() );
} 
  add_action( 'wp_enqueue_scripts', 'files' );
?>