Skip to content

Instantly share code, notes, and snippets.

View gregoirenoyelle's full-sized avatar

Grégoire Noyelle gregoirenoyelle

View GitHub Profile
@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 / 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 / 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 / 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