functions.php 里面放了很多我们常用的函数,我们来整理一下。
让他好看一点。
引用主题根目录文件:
//测试require_once('test.php');引用主题根目录的其他文件:
//设置面板require get_template_directory() . '/inc/test.php';下面的函数是在主题的自定义面板添加一个文本选项框:(放到 functions.php 文件)
//自定义地址function do_customize_register( $wp_customize ) {//do $wp_customize->add_section('header_db',array(//db 'title' => '地址', 'priority' => 50 ) ); $wp_customize->add_setting( 'header_db', array(//db 'default' => '', "transport" => "postMessage", 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'header_db', array(//db 'label' => '首页的地址坐标', 'section' => 'header_db'//db ) ) );}add_action( 'customize_register', 'do_customize_register' );//do