admin管理员组文章数量:1025278
I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at http://domain/blog
.
I tried creating a custom (empty) page called blog
and put some code into page-blog.php
, but the problem is that I can't get The Loop to work in there: the page render aborts right where the display of The Loop should start.
Is a custom page the wrong way to do it?
I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at http://domain/blog
.
I tried creating a custom (empty) page called blog
and put some code into page-blog.php
, but the problem is that I can't get The Loop to work in there: the page render aborts right where the display of The Loop should start.
Is a custom page the wrong way to do it?
Share Improve this question asked Nov 27, 2010 at 11:17 Matteo RivaMatteo Riva 3141 gold badge7 silver badges17 bronze badges4 Answers
Reset to default 6Assuming you are using WordPress v3.x (as I don't remember how this works in earlier versions) this is what you need to do if starting from scratch:
Create a "Page" and call it "Home Page" (or whatever.)
Create another Page and call it "Blog" (or whatever.)
In the admin console select the "Settings" > "Reading" option.
Select "A static page" for the "Front Page Displays" radio button.
Assign "Front Page" to be "Home Page" (or whatever from #1)
Assign "Posts Page" to be "Blog" (or whatever from #2)
Click "Save Changes"
You're done.
Here's a screenshot showing the admin console options:
(source: mikeschinkel)
What did you use for your front page, customized index.php
or home.php
? Is it static or still contains Loop of posts?
Configuration you want is supported by WordPress, but little confusing to explain. See Creating a Static Front Page in Codex.
Essentially approach of creating pages for this is correct, but you must set it up in WordPress and be aware of template technicalities, so that everything works properly.
you can also play locate_template() function, see this tutorial: http://wpengineer/2030/create-a-separate-page-for-blog-posts-in-wordpress/ for creat a seperate blog page and creare the home.php in the Theme als static homepage.
If the objective is to get a blank page, then the suggestions above will only work on certain wordpress themes.
Certain themes have permanent widget data on them even if you perform the procedure suggested by Mike.
The only way I've found that Mike's suggestion works is if the page has an 'Alternative Home' function, which is located in the edit section of the page, on the right side under the Template category; which again only comes with certain templates (Thesis, Elegant).
I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at http://domain/blog
.
I tried creating a custom (empty) page called blog
and put some code into page-blog.php
, but the problem is that I can't get The Loop to work in there: the page render aborts right where the display of The Loop should start.
Is a custom page the wrong way to do it?
I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at http://domain/blog
.
I tried creating a custom (empty) page called blog
and put some code into page-blog.php
, but the problem is that I can't get The Loop to work in there: the page render aborts right where the display of The Loop should start.
Is a custom page the wrong way to do it?
Share Improve this question asked Nov 27, 2010 at 11:17 Matteo RivaMatteo Riva 3141 gold badge7 silver badges17 bronze badges4 Answers
Reset to default 6Assuming you are using WordPress v3.x (as I don't remember how this works in earlier versions) this is what you need to do if starting from scratch:
Create a "Page" and call it "Home Page" (or whatever.)
Create another Page and call it "Blog" (or whatever.)
In the admin console select the "Settings" > "Reading" option.
Select "A static page" for the "Front Page Displays" radio button.
Assign "Front Page" to be "Home Page" (or whatever from #1)
Assign "Posts Page" to be "Blog" (or whatever from #2)
Click "Save Changes"
You're done.
Here's a screenshot showing the admin console options:
(source: mikeschinkel)
What did you use for your front page, customized index.php
or home.php
? Is it static or still contains Loop of posts?
Configuration you want is supported by WordPress, but little confusing to explain. See Creating a Static Front Page in Codex.
Essentially approach of creating pages for this is correct, but you must set it up in WordPress and be aware of template technicalities, so that everything works properly.
you can also play locate_template() function, see this tutorial: http://wpengineer/2030/create-a-separate-page-for-blog-posts-in-wordpress/ for creat a seperate blog page and creare the home.php in the Theme als static homepage.
If the objective is to get a blank page, then the suggestions above will only work on certain wordpress themes.
Certain themes have permanent widget data on them even if you perform the procedure suggested by Mike.
The only way I've found that Mike's suggestion works is if the page has an 'Alternative Home' function, which is located in the edit section of the page, on the right side under the Template category; which again only comes with certain templates (Thesis, Elegant).
本文标签: customizationHow can I create an alternative home page
版权声明:本文标题:customization - How can I create an alternative home page? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745618505a2159435.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论