- WordPress 2.7 Cookbook
- Jean-Baptiste Jung
- 344字
- 2021-04-01 13:55:51
Using a static page as a homepage
Almost 90% of blogs use the list of most recent posts as a homepage. However, if you prefer to use a static page as a homepage, the choice is yours. This technique allows you to use WordPress and create different kinds of web sites—not only blogs.
Getting ready
Nothing special is needed here. The possibility of using a static page as a homepage is built-in in the WordPress—however, a lot of bloggers aren't aware of it.
In this recipe, we will learn how to set up a static page as a homepage for your blog, though, we won't create the entire page for you. Now that you have learned how to create and use page templates, setting up a homepage shouldn't be a problem.
How to do it...
- Log in to your WordPress Dashboard and create a page named Homepage and publish it.
- On your WordPress Dashboard, go to Settings | Reading. You'll see a title saying Front page displays.
- Select the A static page radio button and choose your new front page from the drop-down list. If you please, you can also choose a new template for the posts to be displayed.

How it works...
WordPress allows you to choose between the post lists (most used in blogs) and a static page of your choice as homepage.
This second option gives you quite a few of possibilities, in particular if you'd like to create a non-blog site using WordPress.
There's more...
If you have chosen to use a static page as homepage, how about executing some PHP in it? If this idea seems appealing to you, you should definitely check out the Exec-PHP plugin. You can download it for free at the following link: http://wordpress.org/extend/plugins/exec-php/.
To install Exec-PHP, simply use the standard How to do it... described in Chapter 1. Suppose you want to execute some PHP within a post or a page, you can do it by simply turning the WordPress editor to source mode and starting with coding your PHP.
- ANSYS 14熱力學·電磁學·耦合場分析自學手冊
- VMware虛擬化與云計算:vSphere運維卷
- 虛擬現實:開啟現實與夢想之門
- ADOBE FLASH PROFESSIONAL CS6 標準培訓教材
- Photoshop CC從入門到精通(全彩超值版)
- Android從入門到精通
- Tomcat 6 Developer's Guide
- Google App Engine Java and GWT Application Development
- SolidWorks 2019快速自學寶典
- Seam 2 Web Development: LITE
- Learning the Yahoo! User Interface library
- Microsoft Silverlight 4 and SharePoint 2010 Integration
- SolidWorks 2017基礎與實例教程
- 玩轉微信5.0
- Deep Inside osCommerce: The Cookbook