首页 > web > 换Atahualpa了

换Atahualpa了

Jul 30th,2009 发表评论

换了好多主题,最后还是相信群众的眼光,用了个官网下载量第一的Atahualpa,开发者是:BFA Webdesign。这款atahualpa模板侧重于博客的主体部分,左右两边窄窄的侧边栏更是突出了主间的主体部分,用虚线分块让人觉得很有意思,让整个页面都灵动起来了。Atahualpa在后台提供了强大的配置选项,通过配置这些基本上可以满足修改theme的需求。不过还是改代码有趣,参考了“活力盒子”CKSKY的一些内容。没有彻底改好 打开可能会有些慢…
Atahualpa的单页面留言板问题,atahualpa这样没有single文件的主题,网上有人给出这样的方法(感谢sofish给我们分享):
在你的page.php(如果没有,就是index.php)中加入下面这段代码:

1
<?php if ( get_post_custom_values('comments') ) comments_template() ?>

然后进入后台–>Write a page,在key里填 comments ,Value输入代码

1
<?php comments_template() ?>

点击发布,一切都大功告成了

不过好像直接在index.php加代码不灵,有个老外的说只能把index.php复制为page.php,然后在page.php里面改。至于为什么还是不太清楚…

I am not sure if I understood your question but perhaps you don’t know that WordPress has a built in template system:

WordPress looks for a page.php if a “page” page is requested, and then for index.php. Atahualpa does not have a page.php by default, but if you make a copy of index.php as page.php and upload it, then WP will find it the next time a “page” page is requested and use the page.php to display a “page” page instead of the index.php.

Now many contents of your page.php would be redundant, for instance the queries “is this a page” because page.php is always going to be a page.

Copying index.php to page.php and editing that page.php would be ONE way (the usual way) to create a different layout or functionality for page pages.

But you could as well use index.php for everything (As done by Atahualpa) and add additional “if this is a page” or “if this is page XX” conditions into index.php to display things differently on page pages.

声明: 本文采用 BY-NC-SA 协议进行授权. 转载请注明转自: 换Atahualpa了
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.