Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Genesis Remove Layout Options in Page template
<?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();
<?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
You can’t perform that action at this time.