OptimizePress Plugin Compatibility

As of version 2.6.2, Thesis includes automatic OptimizePress compatibility.

Pages created using the OptimizePress Page Builder will not display as expected, because both the OP plugin and Thesis apply their own respective filters to template_include, and these filters conflict with one another.

To address this issue, add the following code to the Thesis master.php file (located in the /wp-content/thesis folder):

add_action('template_redirect', 'intercept_template', 1);

function op_get_page_template($post_id) {
	return get_post_meta($post_id, '_optimizepress_pagebuilder', true);
}

function intercept_template() {
	if (is_page()) {
		global $post, $thesis;
		$op_template = op_get_page_template($post->ID);
		if ($op_template) {
			remove_filter('template_include', array($thesis->skin, '_skin'), 11);
			add_filter('template_include', 'op_template_include', 1);
		}
	}
}

If you need assistance with implementing this code, or it does not work as expected, please open a support request, and we can assist you personally.