Last active
May 11, 2017 20:27
-
-
Save gregoirenoyelle/ed6582678b59ad9bdd1cb139e0bf3226 to your computer and use it in GitHub Desktop.
Genesis Remove Layout Options in Page template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Template Name: Flexible Recette | |
// Forcer la plein largeur sur le modèle de page | |
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); | |
genesis(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// NE PAS METTRE L'OUVERTURE DU PHP | |
// A mettre dans le fichier function.php de votre thème | |
/* Retirer les options de maquette dans mon modèle de page modele-flexible-recette.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 == 'modele-flexible-recette.php' ) { | |
remove_theme_support( 'genesis-inpost-layouts' ); | |
} | |
} // FIN function custom_remove_custom_layouts() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment