Skip to content

Instantly share code, notes, and snippets.

View 7studio's full-sized avatar

Xavier Zalawa 7studio

View GitHub Profile
@MaximeCulea
MaximeCulea / fake-wp-pagenavi.php
Created April 16, 2019 18:25
Trick WP Pagenavi with a fake WP Query in order to use custom contents which are not WP ones.
<?php
/**
* Trick WP Pagenavi with a fake WP Query ¯\_(ツ)_/¯
*
* We use this method to earn time by using wp_pagenavi() method :
* - no need to reinvent the wheel, the complicated algo is already done
* - it automatically generates the html which is already stylised
* - use wp_pagenavi options from dashboard
* - whereas using custom contents which are not WP ones
*
@felixarntz
felixarntz / wp-plugin-mu-loader.php
Last active October 10, 2022 12:21
WP Plugin MU Loader
<?php
/**
* Plugin initialization file
*
* @package WP_Plugin_MU_Loader
* @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: WP Plugin MU Loader
* Plugin URI: https://gist.github.com/felixarntz/daff4006112b60dfea677ca08fc0b31c
@oriadam
oriadam / colorValues.js
Last active February 9, 2024 16:01
javascript convert any color to array of rgba values
// return array of [r,g,b,a] from any valid color. if failed returns undefined
function colorValues(color)
{
if (!color)
return;
if (color.toLowerCase() === 'transparent')
return [0, 0, 0, 0];
if (color[0] === '#')
{
if (color.length < 7)
@bendc
bendc / randomInterval.js
Created March 9, 2017 21:55
rAF-based random interval
const randomInterval = (() => {
const random = (min, max) => Math.random() * (max - min) + min;
return (callback, min, max) => {
const time = {
start: performance.now(),
total: random(min, max)
};
const tick = now => {
if (time.total <= now - time.start) {
time.start = now;
@johnbillion
johnbillion / install-all-languages.sh
Created February 18, 2017 20:12
Install all available languages on a WordPress site with WP-CLI
wp core language list --field=language | xargs -n 1 wp core language install
@thierrypigot
thierrypigot / acf-polylang.php
Created January 5, 2017 20:31
Add polylang support to ACF fields group
<?php
add_filter('pll_get_post_types', 'wearewp_add_acf_pll', 10, 2);
function wearewp_add_acf_pll( $post_types, $is_settings ) {
$post_types[] = 'acf-field-group';
return $post_types;
}
@ffoodd
ffoodd / improved-sr-only.markdown
Last active April 11, 2024 22:55
Improved .sr-only

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@bendc
bendc / display-fade.html
Created June 22, 2016 03:01
Transitioning the opacity of a hidden element
<!doctype html>
<meta charset="utf-8">
<title>Example</title>
<style>
div {
width: 100px;
height: 100px;
background: black;
animation-duration: .5s;
@mathiasbynens
mathiasbynens / web-platform-status-links.md
Last active April 16, 2024 02:54
Web platform status links
@dbushell
dbushell / steps.txt
Last active November 23, 2015 10:17
WordPress local development (MAMP)
Easy steps for cloning a live WordPress site for local development with MAMP. Am I missing anything?
1. add new MAMP server
2. download all files
3. export MySQL database
4. import SQL to MAMP via command line:
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -p dbname < ~/Downloads/database.sql
5. update: wp-config.php