Difference in menu format between Sparkling parent and child
-
Hi there,
I’m attempting to create a child theme of the Sparkling theme. A basic enqueue script in functions.php makes everything work fine with the exception of the menus.
https://photos.app.goo.gl/SskRbHkJnzEKfjvu8
https://photos.app.goo.gl/dhuiT2L38UQYd7pE6The first image is the menu in the parent theme and the second image is the menu in the child theme. The primary differences are:
1. Menu location is below the header image instead of to the right, and the submenu arrow is also on its own line.
2. The background of the current home page link and the hover over is white-ish instead of the black-ish that matches the menu background.
I’ve checked all of the fields in the “customize” area between the parent and the child and they match.
I have attempted to attach a function to functions.php that involves deregistering the bootstrap style from the parent and registering it to the child. I recognize that there’s some conflicting code between the standard script for enqueuing the child theme and the one that involves the bootstrap, but i’m a hack programmer so i’m not 100% confident, nor am i confident that the bootstrap is the issue.
Help would be appreciated. functions.php script is below:
<?php function example_enqueue_styles() { // enqueue parent styles wp_enqueue_style('parent-theme', get_template_directory_uri() .'/style.css'); // enqueue child styles wp_enqueue_style('child-theme', get_stylesheet_directory_uri() .'/style.css', array('parent-theme')); } add_action('wp_enqueue_scripts', 'example_enqueue_styles'); function enqueue_child_theme_styles() { //deregister the parent bootstrap style and script wp_deregister_style( 'bootstrap' ); wp_deregister_script( 'bootstrap' ); //enqueue my child theme stylesheet wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('theme') ); //enqueue bootstrap in the child theme wp_enqueue_script('bootstrap-js', get_stylesheet_directory_uri().'/bootstrap/js/bootstrap.min.js', array('jquery'), NULL, true); wp_enqueue_style('bootstrap-css', get_stylesheet_directory_uri().'/bootstrap/css/bootstrap.min.css', false, NULL, 'all'); } add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
- The topic ‘Difference in menu format between Sparkling parent and child’ is closed to new replies.