简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

wordpress新站需要修改的7个代码

来源:易贤网   阅读:1128 次  日期:2016-06-28 10:51:44

温馨提示:易贤网小编为您整理了“wordpress新站需要修改的7个代码”,方便广大网友查阅!

1、修改默认登录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');

2、预览模式下取消google分析自动运行

if( !is_preview()):

# google analytics code #

endif;

3、激活小工具段代码

add_filter('widget_text', 'do_shortcode');

4、启用网站维护模式

function maintenace_mode() {

if ( !current_user_can( 'administrator' ) )

{ wp_die('the site will be up soon.');

}

}

add_action('get_header', 'maintenace_mode');

5、取消更新通知

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; ) );

}

6、取消自我追踪

function disable_self_ping( &$links ) {

foreach ( $links as $l => $link )

if ( 0 === strpos( $link, get_option( 'home' ) ) )

unset($links[$l]); }

add_action( 'pre_ping', 'disable_self_ping' );

7、自定义可是编辑器css

$your_custom_stylesheet = 'css/custom-editor-style.css';

add_editor_style($your_custom_stylesheet);

更多信息请查看CMS教程
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:discuz x 主题js与jquery冲突的解决方案
下一篇:如何使用wordpress搭建多站点博客
易贤网手机网站地址:wordpress新站需要修改的7个代码
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
相关阅读      CMS教程