简体   繁体   English

WordPress静态首页和博客页面

[英]WordPress static frontpage and blog page

In my theme, i have defined a front-page.php (witch gets loaded when i visit the front page (url root)) and a home.php file for the blog section (posts). 在我的主题中,我定义了一个front-page.php(当我访问首页(URL根目录)时加载了女巫)和博客部分(帖子)的home.php文件。 I'm a little confused on this, because people are saying different things, and my home.php is loading the front-page.php for some reason? 我对此有些困惑,因为人们在说不同的话,而我的home.php由于某种原因正在加载front-page.php?

I've set front page to be an empty page, and the blog section to show another empty page in the reading settings, but still my front-page.php gets loaded on both pages? 我已将首页设置为空白页面,而博客部分将阅读设置中显示了另一个空白页面,但是我的front-page.php是否仍加载到两个页面上?

How should i do this the correct way when having a static front-page, and want a separate blog page. 拥有静态首页时,并且要有单独的博客页面时,应如何正确执行此操作。

Here, below, is a Snapshot of the WordPress Backend depicting how to set the Static Front-Page and the Posts Page (Blogs). 下面是WordPress后端的快照,描述了如何设置静态首页和帖子页(博客)。 You can find the page depicted in this snapshot at: Settings ==> Reading. 您可以在以下位置找到此快照中描述的页面:设置==>阅读。 When done correctly, everything will work normally. 如果正确完成,一切将正常工作。 In this arbitrary Example, the Front Page corresponds to a Page named: The Ministry and the Blogs [Posts] Page corresponds to a Page named: Christian Blog . 在此任意示例中,首页对应于一个名为:事工页面,博客[帖子]页面对应于一个名为: Christian Blog的页面。

Creating Physical Files (Templates) wouldn't automatically set the Front Page to any arbitrary Page. 创建物理文件(模板)不会自动将“首页”设置为任意页面。 If you need a Static Page, this is where you have to explicitly tell WordPress how to handle it. 如果您需要静态页面,则必须在此处明确告诉WordPress如何处理它。 By default, your Front Page is your Latest Posts until you change the Settings here: 默认情况下,您的首页是您的最新帖子,直到您在此处更改设置为止:

在此处输入图片说明

Make Sure, however, that the chosen Pages already exists in the Pages section of your WordPress Backend. 但是,请确保所选页面已经在WordPress后端的“页面”部分中。

Good Luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM