深圳:气温:31.9℃,风向/风力:东南风 小于3级,湿度:61%
今天,终于把文章按月存档列表显示的问题解决了!
一直以来,月存档都显示的是生成的静态html文章所在的目录列表,在论坛提问后,没有坛友提供解决方法,百度、google也没有找到相应的解决方法。自己也在一边学PHP,一边拿EOS的主题来研究,但未能解决,于是,这个问题就一直悬着。
研究时倒是发现了另外一个问题:EOS主题head中的搜索功能,在分类或者具体文章链接下,无法搜索到整站的内容,于是,研究后,根据searchform.php这个文件中的内容把head.php的搜索框修改如下:
<div>
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<input type="text" name="s" id="SearchQuery" value="<?php _e('活着的博客', 'Eos'); ?>" onfocus="this.value=''" />
<input type="submit" name="submit" value="<?php _e('Find', 'Eos'); ?>" />
</form>
</div>
因为不懂PHP,所以感觉应该是缺少了action="<?php bloginfo('url'); ?>/"这部分(当然还改了其它东西),然后发现能搜索整站了,于是也就这样用了。
昨天晚上有点时间,给Sebastian写信了(我E文不好,还好Sebastian看得懂我写得东西:-) ),提到了二个问题--一个是存档的问题,另外一个就是上面说到的整站搜索问题了。Sebastian的回复:
You are right about Q2. Initially, we left it like it is on intention. However, it might be a good idea to always search the entire site since this seems more intuitive to a user. We have changed this and it will be included with the next update (1.2.9).
As for Q1, that looks to me like a permalink problem. The permalinks are either misconfigured or the .htaccess, which handles redirect, is configured wrong. Try to repair the permalinks.
可以看到,整站搜索功能,将会包含在下个版本1.2.9中。存档的问题,可能是固定链接的设置或者.htaccess设置问题。
我的.htaccess文件只添加了重定向的设置,直接在网上找来用的,其它设置又不会,于是就去看固定链接设置了。原来的固定链接设置是/%year%/%monthnum%/%postname%.html,研究后结合SEO改成了/archives/%postname%.html的形式,把日期部分去掉了。在前台浏览测试,终于正常啦,不再列表显示了~~
至此,基本把博客想要解决的问题解决了。
评论