修改Mozine Theme代码使搜索可用

December 13, 2006 at 0:15 | In WordPress | Leave a Comment

        前几天在网上找到了一个感觉不错的WordPress模板Mozine,是”点点游“网友”Eric Chan”发布的。页面简洁朴实,集成了”WordPress中文工具箱“,功能强大,包含内容多。

        当我把全部theme和plugin文件上传到服务器后,看上去一切都好。但后来发现”搜索”功能有问题。我点出的搜索只是显示出”404页面无法找到”(实际上就是我的服务器提供商的广告页面了)。当时没有找到原因和解决方法,暂时搁置了下来。

        今天下午感到无聊,就把前两天的工作捡了起来,竟然找到了错误原因,下面把解决方法分享给大家。

        首先分析搜索返回后得到的页面地址,我的是http://bluelion.byethost31.com/index.php?s=hello(当时以 “hello”为关键字)。可以看出显示搜索结果页面直接返回到了站点的根目录下,而我的blog目录是在http://bluelion.byethost31.com/blog/目录下,那个index.php文件根本就不在根目录下,肯定显示不出来了。正确的地址应改为 http://bluelion.byethost31.com/blog/index.php?s=hello,在”blog”子目录下。

        下面去找解决方法,我用Instant Source在我blog的主页上找到了下面一段代码

        看来问题就出现在”action=/index.php”这个代码上了。我在mozine theme的文件夹的所有文件里查找这个关键字,发现是在”header.php”里。

        下面就在WordPress控制面板里的Theme Editor里编辑header.php这个文件。将上述代码改为”action=/blog/index.php”

        Update file后,再搜索,终于得到想要的结果

         大家可以根据自己的需要修改上述代码,以得到自己想要的结果。

No Comments Yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.