WordPress 给“特色图像”模块添加说明文字

特色图像 一般是用来作为文章的缩略图的,有些WordPress主题必须为每篇文章设置特色图像才能显示缩略图。如果你的网站后台是多人写作,或者允许投稿,那么你最好给“特色图像”加点说明文字,告诉投稿者,这是做什么用的,如下图:

featured-image-wpdaxue_com

要实现这个功能,只需将下面的代码添加到主题的 functions.php 即可:

/**
 * WordPress 给“特色图像”模块添加说明文字
 * https://www.wpdaxue.com/add-featured-image-instruction.html
 */
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_instruction');
function add_featured_image_instruction( $content ) {
	return $content .= '<p>特色图像将用来作为这篇文章的缩略图,请务必为文章选择一个特色图像。</p>';
}

要确保必须设置特色图像,请参考:WordPress发布文章前强制要求上传特色图像

来源:

https://www.wpdaxue.com/add-featured-image-instruction.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32429.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?