以下代码可以实现,自定义wordpress文章摘要显示的字数长度,数值为字符号,汉字占两个字符。
function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');
以下代码可以实现,自定义wordpress文章摘要显示的字数长度,数值为字符号,汉字占两个字符。
function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');
简洁实用的WordPress企业主题模板
温州wordpress企业主题,用于温州市律师事务所官方网站或律师个人wordpress网站使用。
黑色风格wordpress钟表公司主题,用于钟表厂家或钟表销售公司的企业网站使用。
黄色顶部大图wordpress旅游主题,适用于旅游公司和职业导游个人网站使用。
将以下代码插入到functions.php文件中即可 add_filter("json_enabled", "__return_false"); add_filter("json_jsonp_enabled", "__return_false"); add_filter("rest_enabled", "__return_false"); add_filter("rest_jsonp_enabled", "__return_false"); remove_ac…
将以下代码插入到functions.php文件中,即可禁用Feed。 function wpjzp_feed_disabled() { wp_die("Feed已经关闭, 请访问网站<a href="" . get_bloginfo("url") . "">首页</a>!"); } add_action("do_feed", "wpjzp_feed_disabled", 1); add_act…
将以下代码插入到functions.php文件中即可 add_filter("xmlrpc_enabled", "__return_false"); add_filter("xmlrpc_methods", function ($methods) { unset($methods["pingback.ping"]); return $methods; });
把不常用的代码移除,让wordpress快起来,想要非一样的感觉,可以试试。 remove_action("wp_head", "wp_generator"); foreach (["rss2_head", "commentsrss2_head", "rss_head", "rdf_header", "atom_head", "comments_atom_head", "opml_head", "app_head"] …