pre_common_nav WordPress自动设置文章第一个图片为特色图像
大家在写文章的时候可能会忘记设定特色图像,而有的主题必须设置特色图像在会在相应的位置显示,所以这里有一个办法,自动调用文章中第一个图片来作为wordpress的特色图像。
将下面的代码放到你主题的functions.php文件 ?> 之前:
/* 設定所有文章第一個為特色圖片開始*/
function autoset_featured_image(){
global $post;
$already_has_thumb = has_post_thumbnail($post->ID);
if (!$already_has_thumb){
$attached_image = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1");
if ($attached_image){
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
}
}
}
add_action('the_post', 'autoset_featured_image');
add_action('save_post', 'autoset_featured_image');
add_action('draft_to_publish', 'autoset_featured_image');
add_action('new_to_publish', 'autoset_featured_image');
add_action('pending_to_publish', 'autoset_featured_image');
add_action('future_to_publish', 'autoset_featured_image');
/* 設定所有文章第一個為特色圖片結束*/ 腾讯云存储COS的WordPress远程附件支持插件
现在有50G免费储存和10G流量 话说小站足够玩。
qcloud-cos-support.zip
PLAYLM – 简灰高级WORDPRESS博客/CMS双模式主题
主题简介
Play-LM主题采用Bootstrap v3.3.2框架制作,集成了多种JS效果插件,支持PC、PAD、Mobile phone等多终端浏览(理论支持任意手机的宽度,但是最佳浏览效果为宽度320以上)。
Play-LM主题集成博客模式、CMS模式,后台主题设置支持随意切换,并且每个模式还有不同的搭配展示样式,可谓伪技术宅出品的精品。
WordPress忘记密码找回登录密码的几种行之有效的方法
进入到PhpMyAdmin的SQL执行命令页面,执行以下命令:从字母开始复制
//update wp_users set user_pass=md5("123456") where user_login='admin';123456是你的Wordpress新密码,admin是管理员账号。
2.最简单的找回Wordpress密码:后台用邮件直接找回
当然必须你的主机支持,其中也有更多的办法,这里暂时简单说明
3 最方便的设置Wordpress新密码:用PHP文件重置密码
wppw.rar