资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

wordpress提醒 wordpress tag

wordpress修改登陆时的提醒

能。

创新互联建站专注于龙陵网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供龙陵营销型网站建设,龙陵网站制作、龙陵网页设计、龙陵网站官网定制、小程序定制开发服务,打造龙陵网络公司原创品牌,更为您提供龙陵网站排名全网营销落地服务。

找到网站当前所使用的主题对应的主题functions.php文件,添加以下代码:

function failed_login() {

return '用户名或者密码错误';}add_filter('login_errors', 'failed_login');

参考网页链接

如何关闭Wordpress后台主题和插件自动更新提醒

关闭Wordpress后台主题和插件自动更新提醒的方法

打开你的博客后台地址,输入用户名和密码,点击登陆!

进入后台后,点击“外观”—“编辑”,如图所示!

如果你的博客安装了多个主题,点击右上角,选择你要编辑的主题~

选择编辑主题里面的模板函数 (functions.php),在里面插入代码:

————————————————————————————————

//修改后台显示更新的代码

add_filter('pre_site_transient_update_core',    create_function('$a', "return null;")); // 关闭核心提示

add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;")); // 关闭插件提示

add_filter('pre_site_transient_update_themes',  create_function('$a', "return null;")); // 关闭主题提示

remove_action('admin_init', '_maybe_update_plugins'); // 禁止 WordPress 更新插件

remove_action('admin_init', '_maybe_update_core');    // 禁止 WordPress 检查更新

remove_action('admin_init', '_maybe_update_themes');  // 禁止 WordPress 更新主题

————————————————————————————————

可以根据需要增减代码!

插入代码后,点击最下方的“更新文件”,

成功设置后,后台就再也看不到那些烦人的更新提示了!

小刚SEO为你解答

如何自动提醒WordPress主题使用者安装必要插件

作为WordPress主题开发者,如果你的主题的某些功能需要借助某些插件才能实现,那你需要提醒主题使用者安装这些插件。在倡萌看来,最合理的提醒方法,就是启用主题后,在后台顶部提醒安装,如下图所示:

在 如何在WordPress后台顶部添加错误提醒信息或升级提醒信息 中已经介绍了通过 admin_notices挂钩 显示提醒信息的方法,那么接我们只需要借助 is_plugin_active() 函数来检测所需的插件是否已安装并启用,如果没有安装就进行提醒。

is_plugin_active() 函数简介

is_plugin_active() 函数是专门用来检测插件是否已经安装并启用的,使用的方法很简单,只需要添加对应的插件的主文件路径即可:

if(!is_plugin_active( 'wordpress-popular-posts/wordpress-popular-posts.php' ))

{

echo '需要显示的内容';

}

上面的代码的作用就是:如果没有启用 WordPress Popular Posts,就显示一段提醒文字。’wordpress-popular-posts/wordpress-popular-posts.php’ 就是 WordPress Popular Posts 插件的主文件的路径。

提示安装必要插件

只需要在主题的 functions.php 中添加类似代码,就可以达到本文配图的效果:

add_action('admin_notices', 'showAdminMessages');

function showAdminMessages()

{

$plugin_messages = array();

include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

// Download the Yoast WordPress SEO plugin

if(!is_plugin_active( 'wordpress-seo/wp-seo.php' ))

{

$plugin_messages[] = 'This theme requires you to install the Yoast WordPress SEO plugin, a href=""download it from here/a.';

}

// Download the Disqus comment system

if(!is_plugin_active( 'disqus-comment-system/disqus.php' ))

{

$plugin_messages[] = 'This theme requires you to install the Disqus comment system plugin, a href=""download it from here/a.';

}

// Download the WordPress popular posts plugin

if(!is_plugin_active( 'wordpress-popular-posts/wordpress-popular-posts.php' ))

{

$plugin_messages[] = 'This theme requires you to install the WordPress Popular Post plugin, a href=""download it from here/a.';

}

if(count($plugin_messages) 0)

{

echo '

div id="message" class="error"';

foreach($plugin_messages as $message)

{

echo '

strong'.$message.'/strong

';

}

echo '/div

';

}

}


名称栏目:wordpress提醒 wordpress tag
网页链接:http://cdkjz.cn/article/ddeseid.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220