Last active
July 4, 2016 10:01
-
-
Save gregoirenoyelle/3012482 to your computer and use it in GitHub Desktop.
Genesis Framework Tricks
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 | |
// Action conditionnelle sur des Contenus personnalisés | |
add_action('genesis_before_loop', 'gn_temoignages_filter'); | |
function gn_temoignages_filter() { | |
if ( 'gnpost_temoignage' == get_post_type() || is_post_type_archive('gnpost_temoignage') ) : | |
remove_action('genesis_before_post_content', 'genesis_post_info'); | |
remove_action('genesis_after_post_content', 'genesis_post_meta'); | |
endif; | |
} |
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 | |
// Action conditionnelle sur un modèle de page | |
add_action( 'template_redirect', 'child_remove_page_titles' ); | |
function child_remove_page_titles() { | |
if ( is_page_template( 'nom-template-page.php' ) ) : | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
endif; | |
} |
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 | |
// pour enlever les balises HTML5 autour du titre | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); | |
// pour enlever le titre | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
// pour enlever les info du post, après le titre de l'article | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
// pour enlever l'image à la une générée automatiquement | |
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
// pour enlever le contenu de l'éditeur (contenu classique ou extrait) | |
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); | |
// pour enlever les permaliens sur les archives | |
remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 ); | |
// pour enlever les balises HTML5 autour des métas | |
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); | |
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); | |
// pour enlever les métas du post en bas de l'article | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
// pour enlever la zone auteur après l'article | |
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment