文章归档
WordPress 技巧:在日志下添加作者头像和版权申明
发布于 八月 28, 2010
<?php
/*
Plugin Name: 版权申明
Plugin URI: http://fairyfish.net/m/copyright/
Description: 在日志下面添加版权申明
WordPress 最新、热评、随机日志函数三体合一
发布于 八月 27, 2010
function get_posts($orderby = '', $plusmsg = '') {
$get_posts = query_posts('posts_per_page=10&caller_get_posts=1&orderby='.$orderby);
foreach ($get_posts as $get_post) {
$output = '';
$post_date = mysql2date('y年m月d日', $get_post->post_date);
使用自定义字段给某篇的日志单独加载 Javascript 脚本
发布于 五月 2, 2010
<?php
/*
Plugin Name: Custom Head
Plugin URI: http://fairyfish.net/2009/11/09/custom-head/
Description: 使用自定义字段给某篇的日志单独加载 Javascript 脚本,使用的自定义字段是 custom_head。
Version: 0.1
Author: Denis
Author URI: http://wpjam.com/
*/
add_action("wp_head","custom_head");
function custom_head(){
if (is_single() || is_page()) {
global $post;
$custom_head = get_post_meta($post->ID, 'custom_head', true);
echo $custom_head;
}
}
?>
清理mysql日志文件
发布于 二月 28, 2010
如何关闭MySQL的日志功能:
删除日志:
执行:/usr/local/mysql/bin/mysql -u root -p
输入密码登录后再执行:reset master;
修改/etc/my.cnf 文件,找到
log-bin=mysql-bin
binlog_format=mixed
再这两行前面加上#,将其注释掉,再执行/etc/init.d/mysql restart即可。