春节过去了,想着整理下比较常用的几段代码分享给大家,让新年你的网页更加个性化更加美观更加迅速!另外在这给大家拜年啦!大家龙年吉祥,发财发财啦!更改登陆LOGO function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } </style>';} add_action('login_head', 'custom_login_logo');
新年过去了,想着收拾下比较常用的几段代码共享给咱们,让新年你的网页愈加个性化愈加漂亮愈加敏捷!别的在这给咱们拜年啦!咱们龙年吉利,发财发财啦!
更改登陆LOGO
function custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; }
</style>';
}
add_action('login_head', 'custom_login_logo');
放在functions.php中,假如你比较介意会员体会的话,这个代码是必不可少的。
撤销 Google Analytics
if( !is_preview()):
# Google Analytics Code #
endif;
Google Analytics这个就不必多说了,咱们对待搜索引擎可不能粗心。相同也是放在functions.php中
网站保护代码
function maintenace_mode() {
if ( !current_user_can( 'administrator' ) ) {
wp_die('The site will be up soon.');
}
}
add_action('get_header', 'maintenace_mode');
if ( !current_user_can('administrator') ) {
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
} 自定义可视化编辑器 $your_custom_stylesheet = 'css/custom-editor-style.css';
add_editor_style($your_custom_stylesheet);
知优网 » 页面必备代码(页面的代码)