Skip to content

Instantly share code, notes, and snippets.

View djdmsr's full-sized avatar

Hubert Souchaud djdmsr

View GitHub Profile
@carasmo
carasmo / for-include-or-functions.php
Created January 29, 2018 18:08
Add Custom Post Type and Taxonomy Terms to wp_link_query. Link search function in WordPress editor add Custom Post Types and Taxonomy Terms
<?php
//don't re add the php tag above
add_filter('wp_link_query', 'cab_add_custom_post_type_archive_link', 10, 2);
/**
* Add Custom Post Type archive to WordPress search link query
* Author: https://github.com/mthchz/editor-archive-post-link/blob/master/editor-archive-post-link.php
*/
function cab_add_custom_post_type_archive_link( $results, $query ) {
@softpunch
softpunch / colorVars.css
Last active June 14, 2022 06:44
CSS Variables For Color Manipulation
/* ----
css custom properties to manipulate color
MIT - 2017 - Soft Punch
https://gist.github.com/softpunch/
set initial "main" color via HSL values.
automatically calculate harmonies and variations of that color with pure css.
harmonies are determined solely by hue.
@thadallender
thadallender / vs-wp-starter-content.php
Last active February 26, 2021 07:39
WordPress theme starter content with custom post type and postmeta integration
<?php
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function aperture_setup() {
@MaxArt2501
MaxArt2501 / _cmyk.scss
Last active August 31, 2020 17:09
CMYK helper functions for SASS
@function cmyk_black($color) {
@return 1 - max(red($color), green($color), blue($color)) / 255;
}
@function cmyk_cyan($color) {
$black: cmyk_black($color);
@return if($black < 1, 1 - red($color) / 255 / (1 - $black), 0);
}
@function cmyk_magenta($color) {
$black: cmyk_black($color);