官术网_书友最值得收藏!

  • 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...

  1. Log in to your WordPress Dashboard and create a page named Homepage and publish it.
  2. On your WordPress Dashboard, go to Settings | Reading. You'll see a title saying Front page displays.
  3. 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 to do it...

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.

主站蜘蛛池模板: 鄂温| 太仓市| 静宁县| 屏东市| 武威市| 墨玉县| 遂宁市| 平阴县| 马关县| 广德县| 沁源县| 绥滨县| 德保县| 新巴尔虎左旗| 永济市| 丰都县| 鹿泉市| 礼泉县| 江北区| 邵武市| 陈巴尔虎旗| 阿拉善盟| 桃园市| 阿坝县| 九寨沟县| 锡林浩特市| 五指山市| 东光县| 南皮县| 湖州市| 张掖市| 从化市| 天等县| 天台县| 聊城市| 镇江市| 平阴县| 温州市| 黄大仙区| 凤台县| 鄂托克旗|