在“singale post”页面添加“上一篇”与“下一篇”链接

Thursday, March 27th, 2008

代码如下:添加到模板需要的位置即可 <div class="navigation"> <div class="alignleft"><?php previous_post_link('« %link') ?></div> <div class="alignright"><?php next_post_link('%link »') ?></div> </div> 效果:

在“singale post”页面添加“收藏此页到”标签

Wednesday, March 26th, 2008

这次没有在singal post页面直接添加“代码”而是单独建立一个模板页面:adds.php。 然后在single post模板中要出现的地方使用: <?php include_once("add-to.php"); ?> 就ok啦。 效果图: add.php的代码是: <div class="socialtools"> <h2 class="social-title">收藏此页到: </h2> <?php $UTITLE = the_title('', '', false); $TITLE = urlencode($UTITLE); $URL = get_permalink(); $URL = urlencode($URL); //$IMAGES = get_theme_root_uri() . '/' . get_template() . '/images/social/'; $IMAGES = '/images/'; print('<a href="http://my.poco.cn/fav/storeIt.php?u='.$URL.'&t='.$TITLE.'&c=" title="baidu"><img src="'.$IMAGES.'poco.gif" alt="poco"></img></a>'); print('<a href="http://cang.baidu.com/do/add?iu='.$URL.'&it='.$TITLE.'&dc=&fr=js#nw=1" title="baidu"><img src="'.$IMAGES.'baidu.gif" alt="baidu"></img></a>'); print('<a href="http://bookmark.hexun.com/post.aspx?url='.$URL.'&title='.$TITLE.'" title="hexun"><img src="'.$IMAGES.'hexun.gif" alt="hexun"></img></a>'); print('<a href="http://hot.yesky.com/dp.aspx?u='.$URL.'&t='.$TITLE.'" title="yesky"><img src="'.$IMAGES.'yesky.gif" alt="yesky"></img></a>'); print('<a href="http://www.365key.com/storeit.aspx?u='.$URL.'&t='.$TITLE.'" title="360 sky"><img src="'.$IMAGES.'365key.gif" alt="360 sky"></img></a>'); print('<a ...

专业的Wordpress模板

Tuesday, March 25th, 2008

Webmaster-Source上的31 Professional WordPress Themes中列出了31个免费和付费的Wordpress模版,大部分是新闻杂志型模版。 一、免费模版 1、Gridlock 2、Illacrimo 3、Amazing Grace 4、StudioPress 5、Not So Fresh 6、Gluttony 7、SpringLoaded 8、InSense 9、Digital Pop 10、Blogging Pro 11、ColdBlue 12、GreenTech

仿豆瓣pbdigg模板readme.txt

Tuesday, March 4th, 2008

最简单的安装办法:按照我的目录结构直接上传到空间,然后到后台系统设置——功能设置——选择douban这个风格,就可以啦 若出现发表文章警告或是更新缓存警告,请看后边的解决办法。 演示地址:http://woaikan.clin003.com/ 原模板地址:http://www.pbdigg.net/show/812-1 下载地址:仿豆瓣pbdigg模板下载 截图预览: 这个模板在woaidushu.com基础上做的修改,修改的内容主要有: 调整顶上边的色块颜色为浅绿色 调整使“顶”旁边的“埋”可以看到 调整页面顶部的欢迎语句,使欢迎语和用户登录的用户名搭配,针对会员做欢迎词 修改ui语言语言中的myspace对应中文为“我的空间”,控制面板为——设置(这个想法主要是模仿豆瓣的,感觉豆瓣的这个词语要比pbdigg官方默认的这两个词语跟亲切些) 修改的连接地址有:退出地址,控制面板(设置)地址,发表文章地址 貌似还修改啦些地方,暂时想不起来啦。 自己动手按章模板办法: 1:首先上传模板文件比如douban到templates文件夹下 2:在data\style下建个douban.php内容可以复制pbdigg.php,修改里边的tplpath=>"pbdigg"为tplpath=>"douban",也就是你的模板的文件夹名称。 3:在compile下建个douban文件夹 4:后台系统设置——功能设置——选择风格——douban,提交就可以啦。 若更新缓存或者发表文章出现类似: Warning: articledigs (/home/clin003/domains/woaikan.clin003.com/public_html/data/cache/cache_templates.php) [function.articledigs]: failed to open stream: No such file or directory in /home/clin003/domains/woaikan.clin003.com/public_html/include/Cache.class.php on line 403 Warning: articledigs (/home/clin003/domains/woaikan.clin003.com/public_html/data/cache/cache_templates.php) [function.articledigs]: failed to open stream: No such file or directory in /home/clin003/domains/woaikan.clin003.com/public_html/include/Cache.class.php on line 403 Warning: articledigs() [function.include]: Failed opening '/home/clin003/domains/woaikan.clin003.com/public_html/data/cache/cache_templates.php' for inclusion (include_path='.:/usr/local/lib/php') in ...

修修改改补补

Monday, February 25th, 2008

修修改改补补(wordpress sidebar widget改造和Tags函数,archives函数,categories函数调用) 为啦这个blog空间(wordpress)看起来简洁,用起来速度,脑子发热的时候就来考虑优化,布局空间。 第一件事: 去掉啦sidebar里边的存档widget,和标签云图widget,增加啦导航栏中的“存档” “标签云” 连个连接,觉得这样至少可以使本来就够臃肿的sidebar长度变简短些,少调用次数据库。 做法就是做一个存档页模板页面和一个标签云模板页面,(我是从page.php页面复制后然后修改)。具体代码可以参考: 按月存档:<?php wp_get_archives('type=monthly'); ?> 按分类存档:<?php wp_list_categories(); ?> 标签云页面模板只要知道<?php wp_tag_cloud(); ?>这个就可以啦,这个函数有很多参数具体可以参考:http://codex.wordpress.org/Template_Tags/wp_tag_cloud这里,下边给个完整的使用例子:wp_tag_cloud('smallest=8&largest=22&unit=pt&number=45 &format=flat&orderby=name&order=ASC’) 具体的参数所代表的意义与作用如下 smallest 最小字号,即用于关联日志最少的标签的字号,默认 8 largest 最大字号,即用于关联日志最多的标签的字号,默认 22 unit 字号单位,例如 pt、em、px 等,默认 pt number 数量,即指定最多显示的标签个数,默认 45 format 格式,可选参数有“flat”平铺、“list”列表,默认平铺 orderby 排序方式,默认为“name”即按标签名排列,留空则按照关联日志数来排列 order 排序方向,默认为“ASC”即正序排列,可选参数“DESC”为倒序排列 exclude排除某个标签。每个标签都有一个ID,如果你希望哪一个标签不显示,那就用’exclude=5,27′。那相应的标签就不会显示。默认情况下是没有排除的。 include包括某个标签。跟 exclude相反。如果你用’include=5,27′,那就只显示这两个ID的标签。默认情况下是显示全部标签的。 列举三种定义显示tags效果的代码: <?php the_tags('Article Tags>> ', ' | ' , ''); ?> <?php the_tags('Tags<LI>', '<BR />' , '</LI>'); ?> <?php the_tags('Tags<LI>', '<LI>' , '</LI>'); ?> 标签云的显示效果代码: 块状 ...