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

Posted

tags:

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

<?php 

//
function bprem_theme_setup() {

    //Set Text domain
	load_theme_textdomain( 'bprem' );

	// Add default posts and comments RSS feed links to head.
	add_theme_support( 'automatic-feed-links' );

	/*
	 * Let WordPress manage the document title.
	 * By adding theme support, we declare that this theme does not use a
	 * hard-coded <title> tag in the document head, and expect WordPress to
	 * provide it for us.
	 */
	add_theme_support( 'title-tag' );

	/*
	 * Enable support for Post Thumbnails on posts and pages.
	 *
	 * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
	 */
	add_theme_support( 'post-thumbnails' );

	// This theme uses wp_nav_menu() in two locations.
	register_nav_menus( array(
		'primary' => __( 'Primary Menu',      'bprem' ),
		'social'  => __( 'Social Links Menu', 'bprem' ),
	) );

	/*
	 * Switch default core markup for search form, comment form, and comments
	 * to output valid HTML5.
	 */
	add_theme_support( 'html5', array(
		'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
	) );

	/*
	 * Enable support for Post Formats.
	 *
	 * See: https://codex.wordpress.org/Post_Formats
	 */
	add_theme_support( 'post-formats', array(
		'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
	) );

	/*
	 * Enable support for custom logo.
	 */
	add_theme_support( 'custom-logo', array(
		'height'      => 248,
		'width'       => 248,
		'flex-height' => true,
	) );

}
 // bprem_theme_setup
add_action( 'after_setup_theme', 'bprem_theme_setup' );

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

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

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

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

php [WORDPRESS] - 脚注中的Wordpress动态版权日期#wp #footer #wordpress#functions.php

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

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