Skip to content

Instantly share code, notes, and snippets.

View gregoirenoyelle's full-sized avatar

Grégoire Noyelle gregoirenoyelle

View GitHub Profile
<?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
@gregoirenoyelle
gregoirenoyelle / genesis-image-une-avant-titre.php
Created April 30, 2017 20:24
Genesis Ajouter une image à la une avant le titre
<?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;
/* Theme WordPress Genesis Sample (extrait) */
/* STYLES POUR ORDINATEUR */
html {
font-size: 62.5%; /* 10px browser default */
}
/* Chrome fix */
body > div {
@gregoirenoyelle
gregoirenoyelle / genesis-add-simple-custom-template.php
Last active May 11, 2017 20:27
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
// Move Jetpack Share
// Add to functions.php
// Hook in Genesis Meta
add_action( 'genesis_meta', 'vft_filtre_partage' );
function vft_filtre_partage() {
// Remove default sharing
remove_filter( 'the_excerpt', 'sharing_display', 19 );
remove_filter( 'the_content', 'sharing_display', 19 );
<?php
/*
Zone Auteur
---------------------------------------------------------------------------------------------------- */
/** Retirer la zone auteur sur les single */
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single' );
/** Afficher la zone auteur sur les singles */
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
<?php
/**
* The Template for displaying all single products
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
<?php
/*****
* Voir les hook dans les fichiers:
* /woocommerce/includes/wc-template-hooks.php
* Les fonctions sont ajoutées à un fichier dédié dans mon thème qui est appelé depuis le
* le fichier principal: functions.php
*/
// Ajout de texte avant les vignettes
@gregoirenoyelle
gregoirenoyelle / woocom-genesis-wp-get-products-acf.php
Last active January 21, 2018 06:57
Boucle WooCommece sur mesure avec wp_get_products
<? // Template Name: Boutique avec options
/**
* Ajouter nouveau contenu
* @author Grégoire Noyelle
* @link https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query
* @link https://businessbloomer.com/woocommerce-easily-get-product-info-title-sku-desc-product-object/
*/
add_action( 'genesis_entry_content', 'woomod_nouveau_contenu', 20 );
@gregoirenoyelle
gregoirenoyelle / woocom-enqueue-css.php
Last active January 21, 2018 08:11
Enqueue CSS pour WooCommerce
<?php
/**
* Enqueue CSS pour WooCommerce
*
* Les CSS déclarés dans votre thème seront chargés après ceux de WooCommerce
*
* @package Genesis Sample
* @author Grégoire Noyelle
* @license GPL-2.0+
*/