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 | |
//* Modèle pour les single | |
// Afficher l'image à la une | |
add_action( 'genesis_entry_header', 'gnoyelle_image_une', 9 ); | |
function gnoyelle_image_une() { | |
// Regarde si l'image à la une existe | |
// Sinon, le script s'arrête | |
if ( ! has_post_thumbnail() ) { | |
return; |
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 | |
// Variable vide pour l'affichage le HTML à la fin | |
$output = ''; | |
// Récupérer la valeur du répéteur qui sera un tableau | |
// Elle me servira pour compter les éléments | |
$titres = get_field('ap_textes', $acfw); | |
// Déclaration du compteur | |
$i = 1; | |
// Récupérer le nombre de rang dans le répéteur dans la variable $count |
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 | |
//* Fonction pour WordPress | |
//Enlever la barre Admin en front | |
// show_admin_bar( false ); | |
add_action( 'wp_footer', 'slick_script', 9000 ); | |
function slick_script() { | |
// Si ce n'est pas l'accueil, le script s'arrête |
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: Image avant le contenu | |
//* Affichage du contenu ACF avant le contenu principal | |
add_action('genesis_entry_content','ap_contenu_fiche_cuisinier', 5); | |
function ap_contenu_fiche_cuisinier() { | |
//* Variables ACF pour l'image | |
// L'image ACF est enregistrée en tant que "ID de l'image" | |
$image_id = (int) get_field('nom_du_champ_image_acf'); |
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 | |
// A placer dans le fichier functions.php de votre thème | |
//* Contrôle si Advanced Custom Field est actif sur le site | |
if ( ! function_exists( 'get_field' ) ) { | |
// Variable pour URL de la page Extension | |
function page_plugin_redirect() { | |
return get_bloginfo('url') . '/wp-admin/plugins.php'; | |
} | |
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 | |
/*** | |
* default set up for $in['toolbar1'] | |
* bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,wp_fullscreen,wp_adv | |
* default set up for $in['toolbar2'] | |
* formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help | |
* default set up for $in['block_formats'] | |
* Paragraph=p;Address=address;Pre=pre;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5; Heading 6=h6 | |
* @package TinyMCE | |
*/ |
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 | |
/** | |
* Register widget area. Twenty Fiften Theme | |
* In functions.php file | |
* | |
* @link https://codex.wordpress.org/Function_Reference/register_sidebar | |
*/ | |
function twentyfifteen_widgets_init() { | |
register_sidebar( array( | |
'name' => __( 'Widget Area', 'twentyfifteen' ), |
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 CETTE BALISE | |
// A METTRE DANS VOTRE FICHIER functions.php | |
//* Ajouter le support de page pour les articles | |
add_post_type_support( 'post', 'page-attributes' ); | |
//* Changer ordre d'affichage dans les pages d'archives des articles | |
add_action( 'pre_get_posts', 'gn_post_archive_order' ); | |
function gn_post_archive_order( $query ) { | |
if ( $query->is_main_query() && !is_admin() && $query->is_category() || $query->is_tag() ) { |