Skip to content

Instantly share code, notes, and snippets.

Grégoire Noyelle gregoirenoyelle

Block or report user

Report or block gregoirenoyelle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gregoirenoyelle
gregoirenoyelle / functions.php
Created Mar 3, 2012
Treow Custom Post Type display
View functions.php
<?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
View genesis_change_title.php
<?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() ) );
}
View wp-sql-mise-a-jour.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'
View wp-new-wp-query-light.php
<?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 Jul 4, 2016
Genesis Framework Tricks
View add_action_genesis.php
<?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;
}
View add_custom_image_size_media_window.php
<?php
/****
* New image size
* @gregoirenoyelle
****/
// Create a new image size
add_image_size('Vign Haut de Page', 266, 168, TRUE);
View module-html-css.html
<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">
/*
View media-query-desktop-first-genesis-sample.css
/* Theme WordPress Genesis Sample (extrait) */
/* STYLES POUR ORDINATEUR */
html {
font-size: 62.5%; /* 10px browser default */
}
/* Chrome fix */
body > div {
View balise-ouverture-fermeture.html
<!DOCTYPE HTML>
<html>
<head>
<title>Ma page type</title>
<meta charset="utf-8">
</head>
<body>
<!-- commentaire dans le htlm -->
<p>Mon paragraphe <br />
View acf-single-film.php
<?php
/**
* The Template for displaying all single films.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header(); ?>
You can’t perform that action at this time.