2012-10-19 60 views
0

我试图创建一个主题,只呈现任何东西,但允许访问饲料网址和管理页面。这是这个问题的延续:Make Only Accessible to Feed URL on a WordPress Site只饲料WordPress主题

我用注释标题创建了空style.css,如下所示。

的style.css

/* 
    Theme Name: Only Feeds 
    Description: Renders only feeds. 
    Version: 0.0.1 
    Template: twentyeleven 
*/ 

,并建立了主题目录下的以下空文件。

添加的文件

search.php 
searchform.php 
showcase.php 
sidebar.php 
sidebar-footer.php 
sidebar-page.php 
tag.php 
single.php 
style.css 
404.php 
archive.php 
author.php 
category.php 
comments.php 
content.php 
content-aside.php 
content-featured.php 
content-gallery.php 
content-image.php 
content-intro.php 
content-link.php 
content-page.php 
content-quote.php 
content-single.php 
content-status.php 
footer.php 
functions.php 
header.php 
image.php 
index.php 
page.php 

看来,到目前为止,在工作,但我注意到,当我忘记了创建空single.php,导航的文字出现在单页。这让我担心,如果我失去了一些东西。

此外,如果二十一更新,并发生添加一些文件,会有一个页面输出的东西?

+0

我现在看到有人已经在另一个线程中给了我我的答案。尽管如此,这是正确的。在另一个线程中,我也给出了一种不同的方式来做这件事,因为它更像家里那个地方,它会处理一个孩子的主题,比如你在这里的那个。 –

回答

1

您需要的唯一页面是index.php和style.css,只是不要将其创建为儿童主题而是作为独立主题。这将工作,因为WordPress的自动提供饲料,这个功能不属于任何一个主题。

+0

我排除了除index.php之外的其他文件,并在style.css中删除了行Template:twentyeleven。但是,当我访问单个页面时,它仍然输出页面内容。 – Teno

+0

Ops,这可能是由于浏览器缓存。我再试一次,现在它工作。谢谢。 – Teno