Skip to content

Instantly share code, notes, and snippets.

View gregoirenoyelle's full-sized avatar

Grégoire Noyelle gregoirenoyelle

View GitHub Profile
@gregoirenoyelle
gregoirenoyelle / functions.php
Created March 3, 2012 13:05
Treow Custom Post Type display
<?php
require_once(TEMPLATEPATH.'/lib/init.php');
include_once 'metaboxes/setup.php';
// META BOXEX WP ALCHEMY
// wpalchemy metadonnees
$gn_metadonnees_mb = new WPAlchemy_MetaBox(array
(
'id' => '_custom_metadonnees', // = références
@gregoirenoyelle
gregoirenoyelle / genesis_change_title.php
Created March 5, 2012 07:00
Genesis Framework Base Code
<?php
/**
* Post Title
*/
add_action('genesis_post_title', 'genesis_do_post_title');
function genesis_do_post_title() {
if ( is_singular() ) {
$title = sprintf( '<h1 class="entry-title">%s</h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
}
@gregoirenoyelle
gregoirenoyelle / wp-sql-mise-a-jour.sql
Last active November 25, 2015 20:24
WordPress SQL
## Coller la totalite dans champs SQL de phpMyAdmin ##
## ATTENTION A NE PAS METTRE DE SLASH A LA FIN DES URL ##
# CHANGER URL DU SITE
UPDATE wp_options
SET option_value = REPLACE(option_value, 'http://www.vieuxsite.fr', 'http://www.nouveausite.fr')
WHERE option_name = 'home'
@gregoirenoyelle
gregoirenoyelle / wp-new-wp-query-light.php
Last active July 12, 2018 09:40
WordPress new WP Query
<?php
// article du codex: http://codex.wordpress.org/Class_Reference/WP_Query
// Query sur Catégories d'articles (ID) (inclure)
$ma_boucle = new WP_Query( 'cat=2,6,17,38' );
// Query sur Catégories d'articles (ID) (exclure)
$ma_boucle = new WP_Query( 'cat=-12,-34,-56' );
@gregoirenoyelle
gregoirenoyelle / add_action_genesis.php
Last active July 4, 2016 10:01
Genesis Framework Tricks
<?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;
}
<?php
/****
* New image size
* @gregoirenoyelle
****/
// Create a new image size
add_image_size('Vign Haut de Page', 266, 168, TRUE);
<html>
<head>
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
.text-gras {font-weight: bold;}
</style>
<script type="text/javascript">
/*
/* Theme WordPress Genesis Sample (extrait) */
/* STYLES POUR ORDINATEUR */
html {
font-size: 62.5%; /* 10px browser default */
}
/* Chrome fix */
body > div {
<!DOCTYPE HTML>
<html>
<head>
<title>Ma page type</title>
<meta charset="utf-8">
</head>
<body>
<!-- commentaire dans le htlm -->
<p>Mon paragraphe <br />
@gregoirenoyelle
gregoirenoyelle / acf-single-film.php
Last active December 8, 2018 16:46
ACF Single Film
<?php
/**
* The Template for displaying all single films.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header(); ?>