php WP functions.php

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php WP functions.php相关的知识,希望对你有一定的参考价值。

<?php 
add_theme_support( 'post-thumbnails' ); 
add_image_size('500x250', '500', '250', true);

//remove_action('wp_head', 'rel_canonical');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
remove_action('admin_print_styles', 'print_emoji_styles');
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('admin_print_scripts', 'print_emoji_detection_script');
remove_action('wp_print_styles', 'print_emoji_styles');

add_filter('wp_calculate_image_srcset', '__return_false');
add_filter('xmlrpc_enabled', '__return_false');

remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
remove_filter('the_content_feed', 'wp_staticize_emoji');
remove_filter('comment_text_rss', 'wp_staticize_emoji');

function register_my_menus() {
	register_nav_menus(array(
	'main-menu' => __('Main Menu'),
	'footer-menu' => __('Footer Menu'),
	));
}

//add_action('init', 'register_my_menus');

以上是关于php WP functions.php的主要内容,如果未能解决你的问题,请参考以下文章

php functions.php - 删除WP表情符号

php WP - functions.php中的基本功能

PHP WP添加后缩略图 - functions.php

php 通过functions.php控制WP修订版

php 通过functions.php将Google字体添加到WP

PHP Wordpress:通过functions.php自定义wp-login.php