Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I made a child theme defined as so:

/*
Theme Name: GlenTheme
Description: Modified Gallery 2.3 theme
Template: gallery
*/

@import url("../gallery/style.css");

The only file in the child theme is this style.css

Within the menu, though, the markup is coming up differently: in the child theme the menu comes out like this (partially):

  <div id="menu" class="dropdown">
  <div class="home"><ul><li class="page_item page-item-5057">

While in the parent theme it comes out like this:

  <div id="menu" class="dropdown">
  <ul id="nav" class="home"><li id="menu-item-5049" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-5049">

As I understand parent-child themes they should be identical, but clearly something in the markup is getting changed, the code governing this is the menu function..

I could obviously rewrite the menu styles to make them apply properly to the different markup, but I really want to know why there's any different markup in the first place!

share|improve this question
    
What files are in your child theme? –  Brian Fegter Oct 27 '11 at 12:45
    
just the style.css –  Damon Oct 27 '11 at 14:17
add comment

1 Answer

This is possibly because you had a menu assigned, then you changed themes, and now there is no longer a menu assigned. Because Wordpress generates slightly different html for an assigned menu than for an autogenerated menu, this is likely why you have the issue.

For example, on a theme of mine Im developing, if I changed them and back the menu was pushed down 20 pixels, which was gone when I assigned my header menu, some tweaked CSS rules corrected the issue.

share|improve this answer
    
Exactly right! Just because the Theme template files are identical doesn't mean that theme_mods (such as Menus, header image, background, Widgets) are identical. Neither theme_mods nor Theme Options automatically propagate from Parent Theme instance to Child Theme instance on a given site. –  Chip Bennett Oct 27 '11 at 14:56
    
Not even that, in my example, the two themes I switched were near enough identical with the same parent theme, simply switching themes removes the settings for which menu goes where, those settings don't persist once the theme is deactivated –  Tom J Nowell Oct 27 '11 at 15:31
    
"the settings for which menu goes where" - yes, those settings are part of theme_mods. :) Since theme_mods are Theme-specific, they don't carry over from one Theme to another (including from a Parent Theme to a Child Theme). –  Chip Bennett Oct 27 '11 at 15:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.