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 | |
$o = array(); | |
$o[ 'title' ] = wp_title( '', false ); //me sert pour mettre à jour le titre de la fenêtre de navigation | |
$o[ 'type' ] = 'liste'; // le type du template | |
$o[ 'breadcrumb' ] = ffeeeedd__ariane(); //me sert pour mettre à jour le fil d'ariane | |
$q = get_search_query(); | |
if( have_posts() ) : |
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
jQuery( document ).ready( function( $ ) { | |
function resizeCallback() { | |
var size = 0; | |
$blocs = $( '.same-size' ) | |
$blocs.css( 'height', 'auto' ); | |
$blocs.each( function() { | |
size = $( this ).innerHeight() > size ? $( this ).innerHeight() : size; | |
} ); | |
$blocs.css( 'height', size ); | |
} |
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 | |
// Ajout de metabox dans le BO | |
add_action("add_meta_boxes", "willy_create_metaboxes", 10, 2); | |
function willy_create_metaboxes( $post_type, $post ) { | |
if ( 'product' == $post_type ) { | |
add_meta_box("artiste","Artiste","artiste_zik", $post_type,"side","high"); | |
} | |
} | |
add_action('save_post', 'willy_save_post'); |
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
.willy-espace-membre-wrapper{ | |
margin-right:-57px; | |
} | |
.willy-espace-membre{ | |
margin-top:-18px; | |
} | |
.willy-espace-membre .w-button{ | |
font-size:13px; |
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
//Ligne 49 à 56 | |
// Remplace... | |
$urlinscr = ( $idc = get_option( 'wem_page_inscr' ) ) ? esc_url( get_permalink( $idc ) ) : ''; | |
$out[] = '<button class="willy-espace-membre-connexion w-button" data-target="wem-connexion" id="wem-connexion-button">' . __( 'Connexion', 'wem' ) . '</button> <span class="wem-pipe">|</span>'; | |
$out[] = '<a class="willy-espace-membre-inscription w-button" href="' . $urlinscr . '">' . __( 'Inscription', 'wem' ) . '</a>'; | |
$connectform = array(); | |
$styleform = isset( $_GET['message'], $_GET['shake'] ) ? 'style="display:block;"' : 'style="display:none;"'; | |
$connectform[] = '<div class="willy-espace-membre-connect-form" id="wem-connexion" ' . $styleform . '>'; |
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 rajouter ligne 420 | |
echo '<div class="wem-avatar">' . get_avatar( $userdata->user_email, 100, get_option( 'avatar_default' ), $userdata->display_name ) . '<p class="wem-modif-avatar">' . sprintf( __( 'Utilisez <a href="%s" target="_blank">le service Gravatar</a> pour personnaliser votre image de profil.', 'wem' ), 'https://fr.gravatar.com/' ) . '</p></div>'; | |
// CSS à rajouter | |
/* | |
.wem-avatar{ | |
padding-bottom:1em; | |
overflow:hidden; |
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 | |
/** | |
* Pour avoir une structure de slug plus logique | |
*/ | |
add_action( 'init', 'mescpts' ); | |
function mescpts() { | |
register_post_type( 'recette', array( | |
'label' => 'Recettes', | |
'public' => true, | |
'supports' => array( 'title', 'editor', 'thumbnail' ), |
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 | |
add_filter( 'get_sample_permalink_html', 'willy_filter_fake_permalink', 10, 4 ); | |
function willy_filter_fake_permalink( $return, $id, $newtitle, $newslug ) { | |
remove_filter( 'get_sample_permalink_html', 'willy_filter_fake_permalink' ); | |
if ( $newslug === NULL ) { | |
if ( 'post' == get_post_type( $id ) ) { | |
$return = preg_replace( "/id=\"editable-post-name\"([^>]*)>/", "id=\"editable-post-name\"$1>actualite-", $return ); | |
$return = preg_replace( "/id=\"editable-post-name-full\">/", "id=\"editable-post-name-full\">actualite-", $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 | |
add_action( 'plugins_loaded', function() { | |
global $sitepress; | |
if( ! isset( $_REQUEST['icl_ajx_action'] ) && isset( $_POST[ 'mylang' ] ) ) { | |
$reflection = new ReflectionClass( 'SitePress' ); | |
$admin_language = $reflection->getProperty( 'admin_language' ); | |
$admin_language->setAccessible( true ); | |
$admin_language->setValue( $sitepress, $_POST[ 'mylang' ] ); | |
} | |
} ); |
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 | |
add_action( 'init', 'register_my_taxo' ); | |
function register_my_taxo() { | |
register_taxonomy( 'immo_cat', 'immobilier', array( | |
'hierarchical' => false, | |
'label' => 'Type de biens', | |
// je déclare le slug de taxo de manière à pouvoir le traduire | |
'rewrite' => array( 'slug' => icl_t('nebula', 'property-type-slug', 'type-bien-immobilier' ) ), | |
) ); | |
} |