saragreenlaw
9/8/2017 - 5:46 PM

remove-layouts.php

add_action( 'init', 'custom_remove_custom_layouts' );
function custom_remove_custom_layouts() {
    // Condition pour éviter une notice PHP
    if ( ! isset( $_GET['post'] ) ) {
		return;
	}
    $template_file = get_post_meta( $_GET['post'], '_wp_page_template', true );
    if ( $template_file == 'flex.php' ) {
        remove_theme_support( 'genesis-inpost-layouts' );
    }
		$template_file = get_post_meta( $_GET['post'], '_wp_page_template', true );
		if ( $template_file == 'sales-page.php' ) {
				remove_theme_support( 'genesis-inpost-layouts' );
		}
}