Wordpress 2014 子主题设置

Wordpress 2014 child theme setup

我无法激活 wordpress 2014 主题的子主题。 我创建了一个文件夹 twentyfourteen-child。我有一个 style.css 和

1 /*  
2 Theme Name:Twenty Fourteen Child
3 Version: 1.0
4 Theme URI: link
5 Description: A basic starter child theme for Twenty Fourteen 
6 Author: Tim 
7 Author URI: link
8 Template: twentyfourteen
9 License: GPL 
10 License URI: ...
11 */

还有 functions.php 和

 1<?php
 2 add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
 3 function enqueue_parent_styles() {
 4         wp_enqueue_style( 'parent-style',  get_template_directory_uri().'/style.css');
 5 }

我是 运行 另一个具有相同主题和相同代码的 wordpress 站点,运行良好。两个网站都安装在子目录下 style.css 中的模板名称与父主题的目录名称匹配。我基本上只是复制了这两个文件。

当我激活子主题时,菜单结构被破坏。侧面包含左侧和顶部的菜单,但现在它们都合并在顶部菜单中。有人知道这里可能出了什么问题吗!?

如果您已经设置了您的主题并在之后激活了您的子主题,您必须重新分配您的菜单的真实外观 -> 菜单。