修改wordpress日历

修改wordpress日历

Filed under: IT |  

【资料来源于网上】

wordpress自带了一个日历函数get_calendar(),可以显示每天各发了哪些文章(把鼠标移到日期上即可看到),是个很实用的函数。可是它原来的式样太丑了,以至于很少有人直接使用这个函数,多数人是寻找其它的插件来实现的。其实没有必要,装太多插件会让系统变慢,而且这个自带的函数本身功能已经足够,我们需要的只是修改式样,而这可以通过直接修改原函数来实现。 get_calendar()位于/wp-includes/general-template.php,代码生成html的部分都很容易懂,直接修改这些部分即可,只需要懂一些基本的html知识即可。 共享一下我修改过的get_calendar函数,详见附件

【附件】get_calendar_ster.txt

?直接插入文件/wp-includes/general-template.php即可,注意放在文件最后的”?>”之前。为了防止破坏原文件,把函数名改为了get_calendar_ster(),调用的时候使用get_calendar_ster();即可,原函数get_calendar();可继续使用。

修改/wp-includes/widgets.php文件:

大概在510行,将get_calendar();修改成get_calendar_ster();


Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

If you want to leave a feedback to this post or to some other user´s comment, simply fill out the form below.

(required)

(required)