Thesis IE8 – Remove IE7 Emulation

by Tim Milligan on May 8, 2012 · 0 comments

I’ve posted this solution numerous times on the forums before so it’s probably high time I post it here…

A lot of you may have run into (repeated) issues with IE8 where it doesn’t render Thesis sites properly.  9 times out of 10 that’s because Thesis is telling IE8 to render the site as if it’s IE7.  This causes a whole slew of issue from css clears not being effective, z-indexes not functioning properly etc.

Fortunately, it’s a very easy problem to solve on your own (as we wait for them to remove the emulation from Thesis’ base code)

Add the following to your custom_functions.php and voila, problem(s) solved.

function remove_ie7_emulation() {
    $browser = $_SERVER['HTTP_USER_AGENT'];

    if (preg_match("/MSIE 8.0/", $browser) && !is_admin())
        header('X-UA-Compatible: IE=8');
}
add_action('init','remove_ie7_emulation');

Master Header and Stylesheet for Thesis Multisite

by Tim Milligan on March 26, 2012 · 0 comments

So I recently started playing around with WP Multisite to get ready for a project I’ll be doing down the road.  With Thesis 1.8.4 they’ve added better support for multisite, but there were a few things that were missing for my purposes.

Basically the model I’ve been testing is an organization site where each user has their own sub-site where they can put up various information, post their own blog etc.

site.com
site.com/user-1
site.com/user-2
etc.

So to that effect I want to keep the overall design and nav elements the same.  This is where Thesis doesn’t handle things automatically.  With 1.8.4 Thesis gives you a master control custom_functions.php so you can change aspects of your entire network in one shot (wicked!) however, the master custom.css does not affect all the network sites.

So I had to re-add the master custom.css file back into each of the sites.

function master_thesis_custom_stylesheet() {
    $handle = 'master_custom';
    $src = get_stylesheet_directory_uri() . '/custom/custom.css';
    $media = 'screen, projection';
    wp_register_style($handle, $src, $deps, false, $media);
    wp_enqueue_style($handle);
}
add_action('wp_enqueue_scripts', 'master_thesis_custom_stylesheet');

My next step was to change the header of all sites to be the same as the base site.  This I accomplished by using the same code Thesis uses to generate the header, with one subtle difference.

function master_thesis_default_header() {
    thesis_hook_before_title();
    switch_to_blog(1);
    thesis_title_and_tagline();
    restore_current_blog();
    thesis_hook_after_title();
}
remove_action('thesis_hook_header', 'thesis_default_header');
add_action('thesis_hook_header', 'master_thesis_default_header');

The switch_to_blog() function temporarily switches all details of the site (with some exceptions) to the master site and the restore_current_blog() changes it back to the current one.  That way the site name, url etc. that the thesis_title_and_tagline() function uses is from the master site.

Finally, using the same technique as I did with the header I added in a master nav menu* to the site:

function master_thesis_nav_menu() {
    switch_to_blog(1);
    thesis_nav_menu();
    restore_current_blog();
}
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_before_header', 'master_thesis_nav_menu');

If you’re after a left nav instead:

function master_left_menu() {
    switch_to_blog(1);
    echo "<li id=\"nav_menu-main\" class=\"widget widget_nav_menu\">\n";
    wp_nav_menu(array('menu' => 'Left Nav','menu_class' => 'menu','container' => 'div'));
    echo "</li>\n";
    restore_current_blog();
}
add_action('thesis_hook_before_sidebar_1', 'master_left_menu');

* You need to create the menu as a wp_menu in the base site first.

WP Vertical Nav in Sidebar with Thesis

October 7, 2011

There’s been a couple people asking how to get a wp vertical nav in their sidebar.  This post covers how to get over the technical css issues, the prettyfication you can do on your own after the fact. Step 1 – Setup your wp-nav Step 2 – Add the nav to your sidebar using the [...]

Read the full article →

Thesis Full-Width Nav

October 7, 2011

I’m mainly posting this so I have somewhere to reference people rather than copying and pasting the coder every time. Originally developed by Kristarella The following adds a full-width nav below the header area:

Read the full article →

Add custom author class to body

October 4, 2011

The following code adds a custom body class to all posts and author pages in the form of author-# where # is the ID of the author.

Read the full article →

IE Z-Index Solution for Thesis multi-line nav with submenus

September 1, 2011

So lots of people are having issues with Thesis in IE7 and IE8 where subnav items appear beneath the other rows of the nav if their nav spans multiple rows.  Well I finally came up with a solution.

Read the full article →

Caption Test

May 30, 2011

Caption Test 1234567890 This is where we put the words and they are flowing swimmingly etc. Image Aligned Right

Read the full article →

Querystring Test

September 28, 2010
Read the full article →

Teaser Rollover Test

May 6, 2010
Thumbnail image for Teaser Rollover Test

Teaser rollover test (working! )

Read the full article →