1.编辑器改以前的经典模式
安装插件Classic Editor

2.后台–>外观–>菜单,不显示
functions.php中要添加

<?php
// 注册导航菜单位置
register_nav_menus( array(
    'main_menu' => '主导航菜单'
) );

3.文章或者页面,设置特色图片功能不显示
functions.php中要添加

add_theme_support('post-thumbnails');

4.后台不显示,自定义Logo功能
functions.php中要添加

function mytheme_add_custom_logo(){
    add_theme_support( 'custom-logo', array(
        'height'      => 100,
        'width'       => 300,
        'flex-height' => true,
        'flex-width'  => true,
    ) );
}
add_action( 'after_setup_theme', 'mytheme_add_custom_logo' );

页面中显示

<?php
if ( has_custom_logo() ) {
 the_custom_logo();
}
?>

5.自定义产品列表页面
创建category-product.php

6.块样板
https://wordpress.org/patterns/?curation=community

7.page页面指定模板
模板目录中有文件page[xxx].php的文件的时候该功能才会显示。

/**
 * Template Name: Contact Us
 */
作者 铁血 汉子 7 天前
2026/10/25/11:52:14am 2026/10/18/12:01:32
0 42