ThemeShaper Forums » Thematic

[closed]

9.8 (9.7.8) dev release breaks layout

(11 posts)
  • Started 11 years ago by nimmolo
  • Latest reply from nimmolo
  • This topic is resolved
  1. nimmolo
    Member

    After reading enough encouragements I installed the latest dev release from Thematic4You.

    Suddenly #main does not inherit anything from #wrapper?!?!?

    My layout is not behaving properly at all - #wrapper seems to stop after the header, and #main is following its own rules; it's not obeying wrapper's max-width and is using 100% of screen width. Check it at andrewnimmo.com/mistersaturdaynight if you like.

    There were no problems before I updated the Thematic and no changes since, either.

    Obviously I will revert in a few days but I'm posting this because it might be of interest to developers.

    Posted 11 years ago #
  2. the problem is not w/ thematic. you have some improperly closed html markup somewhere.

    in chrome dev tools your site looks like:

    <div id="wrapper">
    <div id="header"></div>
    </div>
    
    <div id="main">
    </div>
    Posted 11 years ago #
  3. middlesister
    Member

    Like you say, the #wrapper is no longer wrapping the page but only the header. Of course #main will not be affected by wrappers max-width since it is no longer inside it.

    This means that there is an extra closing div tag somewhere in the header. A quick look at your source code reveals that it has to do with the #branding. It is closed twice.

    Don't know how your code looks like, but there is a thematic_brandingopen as well as a thematic_brandingclose so make sure you don't close it twice by adding the closing div tag in thematic_brandingopen. I honestly don't know if this has to do with upgrading to the latest dev release. Both of these filters were there before so it's probable this issue has been there all along but just not visible until now.

    EDIT - hah Helga was before me :-)

    Posted 11 years ago #
  4. cause i'm ninja like that. your explanation is more thorough however

    Posted 11 years ago #
  5. nimmolo
    Member

    Och! My mistakes are foiled by smart people once again.

    Thanks!

    Jeez louise you would think i would have thought to check the dev tools but I was SO SURE my markup was a-ok.

    Posted 11 years ago #
  6. nimmolo
    Member

    OK - *edit* see below :)

    Posted 11 years ago #
  7. nimmolo
    Member

    OK no that didn't do it. I'm reading helga's post below now, i will make those changes...

    It's my inelegant code and the double branding close.

    For some reason, under 9.7.8 the new childtheme_override_brandingclose() now ran IN ADDITION TO thematic_branding_close(), not INSTEAD OF.

    So I'm now removing thematic_branding_close() manually instead of relying on the childtheme function override. Didn't use to have to do that!!!

    I think that could be a problem in header-extensions.php of 9.7.8, i will now investigate.

    Posted 11 years ago #
  8. i think you have some code cleanup you could stand to do to make the code more elegant and therefore easier to maintain in the future:

    you don't need to do childtheme_override_something() and add_action('action', 'childtheme_override_something');

    if you are using overrides, you don't need to remove_action() the original action

    for sanity's sake you shouldn't name functions childtheme_override if they don't actually override anything, like your childtheme_override_init_navmenu. there isn't a thematic_init_navmenu function. it works, sure, but it gets confusing.

    why are you overriding access? doesn't look like you are doing anything except moving it? remove_action, then add_action back on new hook.

    Posted 11 years ago #
  9. nimmolo
    Member

    OK. got it. Sorry for deleting the bloated code, did it before i read your reply.

    Here it is on a diet. I didn't know that about not having to add the action but of course it makes sense, it's built into the conditional syntax in header-extensions.php.

    Anything else I could pare out of here?

    I started with the childtheme_override_access() because the mobile childtheme does indeed override thematic_access() and i wanted them to be similar. Unnecessary here though.

    // Let's add those mobile navmenus 
    
    function register_mobile_navmenus() {
            if (function_exists( 'register_nav_menus' )) {
                register_nav_menus(
                	array(
                		'primary-menu' => __( 'Masthead Navigation', 'thematic' ), 'mobile-menu' => __( 'Mobile Navigation', 'thematic')) );
            }
        }
    
    	add_action('init', 'register_mobile_navmenus');
    
    // HEADER ACTIONS, Nimmo style.
    
    function remove_defaults() {
        remove_action('thematic_header','thematic_brandingopen',1);
        remove_action('thematic_header','thematic_access',9);
    }
    	add_action('init','remove_defaults');
    
       	add_action('thematic_header','thematic_access',1);
        	add_action('thematic_header','thematic_brandingopen',2);
    
    	// Open #branding and add the branding image this way
    	// In the header div
    
    		function childtheme_override_brandingopen() {
    			echo '<div id="branding"><a href="' . home_url() . '"><img src="/mistersaturdaynight/wp-content/uploads/header-images/WP9-winter.png"></a>';
    		}
    
    	// Dis the blog title
    	// In the header div
    
    	    function childtheme_override_blogtitle() { }
    
    	// Dis the blog description
    	// In the header div
    
    	    function childtheme_override_blogdescription() {   }
    
    // End of functions that hook into thematic_header()
    Posted 11 years ago #
  10. lean and mean.

    one last thing: you could put that image in your theme folder if you wanted (instead of hard linking it)

    src="<?php echo stylesheet_directory_uri() . '/images/WP9-winter.png';?>"

    also, looks like you can mark this as resolved

    Posted 11 years ago #
  11. nimmolo
    Member

    thanks Helga!!!

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.