Skip to content

Instantly share code, notes, and snippets.

View nicomollet's full-sized avatar

Nico Mollet nicomollet

View GitHub Profile
@nicomollet
nicomollet / wp-config-local.php
Last active August 29, 2015 14:06
WP config Local environment
<?php
//----- Environment -----//
define('WP_ENV', 'local');
//----- Database -----//
define('DB_NAME', '<dbname>');
define('DB_USER', '<dbuser>');
define('DB_PASSWORD', '<dbpassword>');
define('DB_HOST', '<dbhost>');
@nicomollet
nicomollet / wp-config-prod.php
Last active June 1, 2023 01:12
WP config Prod environment
<?php
//----- Environment -----//
define('WP_ENV', 'production');
//----- Database -----//
define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', '');
@nicomollet
nicomollet / addthis-customurl.html
Last active June 9, 2023 13:14
Addthis: sharing buttons with custom URL
<div class="addthis_sharing_toolbox" data-url="http://customurl.com" data-title="customtitle"></div>
<script type="text/javascript">
var addthis_share = addthis_share || {};
addthis_share = {
passthrough: {
twitter: {
via: 'twitteraccount',
text: 'lorem ipsum'
}
@nicomollet
nicomollet / addthis-customorder.html
Last active August 29, 2015 14:07
Addthis: sharing buttons with custom order
<div class="addthis_toolbox addthis_32x32_style addthis_default_style">
<a class="addthis_button_email"></a>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_google_plusone_share"></a>
<a class="addthis_button_linkedin"></a>
<a class="addthis_button_facebook_like"></a>
<a class="addthis_button_tweet"></a>
@nicomollet
nicomollet / editor-styles.php
Last active August 29, 2015 14:07
Wordpress Editor Styles
<?php
function custom_tinymce_styles( $settings ) {
$style_formats_original = json_decode( $settings['style_formats'] );
$style_formats = array(
// Inline style
array(
'title' => 'Color Red',
'inline' => 'span',
@nicomollet
nicomollet / wp-config.php
Created October 19, 2014 15:44
Wordpress load config
<?php
// Load locale database configuration
require_once realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'wp-config-locale.php');
@nicomollet
nicomollet / admin-scheme.php
Last active June 9, 2023 13:14
Wordpress Admin Color Scheme
<?php
// Generate an admin scheme using the generator here: http://themergency.com/generators/admin-color-scheme-generator/
// Copy the css file in css/admin.css
// Then include this function in your functions.php
// And setup the four hexadecimal colors
function custom_admin_color_schemes() {
$theme_dir = get_template_directory_uri();
wp_admin_css_color( 'nameofscheme', 'Name of Scheme',
$theme_dir . 'css/admin.css',
@nicomollet
nicomollet / breadcrumb-trail.php
Last active August 29, 2015 14:07
Wordpress Custom Breadcrumb Trail for StormBringer
<?php
// To customize the Breadcrumb, use this function in functions.php:
function custom_breadcrumb_trail_args(){
$args = array(
'separator' => '›', //Separator text
'before' => '' , // HTML displayed before
'after' => false, // HTML displayed after
'front_page' => true, // Display the homepage link
@nicomollet
nicomollet / breadcrumb-posttypearchive.php
Last active August 29, 2015 14:08
Wordpress Breadcrumb Trail for Custom Post Type
<?php
// Adds a custom breadcrumb item at position 1 (just after Home >)
function custom_breadcrumb_trail($trail ){
if( is_tax('custom_taxonomy') ){
$post_type_obj = get_post_type_object('custom_post_type');
$title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
$newtrail = array( '<li><a href="'.get_post_type_archive_link( 'custom_post_type' ).'">'.$title.'</a></li>' );
array_splice( $trail, 1, 0, $newtrail ); // splice in at position 1
@nicomollet
nicomollet / wp-cli.yml
Last active May 29, 2017 14:25
WP CLI download+install configuration
path: wordpress
url: http://project.l
core download:
locale: fr_FR
core config:
dbuser: project
dbpass: project
dbname: project