簡體   English   中英

WordPress的樣式表包括不工作

[英]Wordpress stylesheet include not working

我已經編碼了一個自定義網站,並且正在使用Wordpress進行托管。 目前,我正在嘗試僅鏈接index.php和style.css。 我得到的只是空白頁或沒有CSS的html。 CSS與index.php是同一目錄。 我究竟做錯了什么? 我一直在嘗試一切。

    <!doctype html>
<html>
<head>
<title>Goats for Sale | Clayson Ridge Farm</title>
<meta name="description" content="High-quality, purebred goats by Clayson Ridge Farm. Prize-winning Alpine and Nubian goats for sale. We ship all across Canada. Reserve your goat today." />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" media="screen" />

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
</head>

試試這個,我用stylesheet_url

admin_email          = admin@example.com
atom_url             = http://www.example.com/home/feed/atom
charset              = UTF-8
comments_atom_url    = http://www.example.com/home/comments/feed/atom
comments_rss2_url    = http://www.example.com/home/comments/feed
description          = Just another WordPress blog
home                 = http://www.example.com/home (DEPRECATED! use url option instead)
html_type            = text/html
language             = en-US
name                 = Testpilot
pingback_url         = http://www.example.com/home/wp/xmlrpc.php
rdf_url              = http://www.example.com/home/feed/rdf
rss2_url             = http://www.example.com/home/feed
rss_url              = http://www.example.com/home/feed/rss
siteurl              = http://www.example.com/home (DEPRECATED! use url option instead)
stylesheet_directory = http://www.example.com/home/wp/wp-content/themes/largo
stylesheet_url       = http://www.example.com/home/wp/wp-content/themes/largo/style.css
template_directory   = http://www.example.com/home/wp/wp-content/themes/largo
template_url         = http://www.example.com/home/wp/wp-content/themes/largo
text_direction       = ltr
url                  = http://www.example.com/home
version              = 3.5
wpurl                = http://www.example.com/home/wp

更換

<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>" media="screen" />

嘗試這個

<link rel="stylesheet" type="text/css" href="<?php  get_stylesheet_directory_uri(); ?>/style.css" media="screen" />

get_stylesheet_directory_uri()=>這將返回模板目錄路徑,而不是需要的style.css。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM