View wp-class-eric.php
<?php | |
class Eric{ | |
function __construct(){ | |
add_action( 'init', [ $this, 'remove_category_for_posts' ] ); | |
add_action( 'init', [ $this, 'add_category_for_pages' ] ); | |
add_filter( 'register_taxonomy_args', [ $this, 'rename_category' ], 10, 3); | |
add_action( 'pre_get_posts', [ $this, 'category_archives' ] ); | |
} |
View grid-media.css
/* Grille avec media queries */ | |
.grids { | |
max-width: 1140px; | |
margin: 0 auto; | |
display: grid; | |
grid-gap: 0 1rem; | |
grid-template-columns: repeat(1, 1fr); | |
} |
View demo.html
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>JavaScript Auto Adjust iFrame Height Based on Content</title> | |
<style> | |
iframe{ | |
width: 100%; | |
border: 2px solid #ccc; | |
} |
View gist:80a825e8010e74311c1bbafc77cedea1
INITIALISATION | |
============== | |
load wp-config.php | |
set up default constants | |
load wp-content/advanced-cache.php if it exists | |
load wp-content/db.php if it exists | |
connect to mysql, select db | |
load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
load wp-content/sunrise.php if it exists (multisite only) |
View wearewp-cpt-glance.php
<?php | |
/* | |
Plugin Name: Custom post type counts | |
Description: Custom post type counts in 'Right now' Dashboard widget | |
Plugin URI: https://www.wearewp.pro | |
Version: 1.0 | |
Author: WeAre[WP] | |
Author URI: https://www.wearewp.pro | |
*/ |
View wpml-config.xml
<wpml-config> | |
<admin-texts> | |
<key name="theme_mods_{THEMENAME}"> | |
<key name="fl-topbar-col1-text" /> | |
<key name="fl-logo-image-retina" /> | |
<key name="fl-logo-image" /> | |
</key> | |
</admin-texts> | |
</wpml-config> |
View functions.php
<?php | |
// Show javascript handle | |
add_filter( 'script_loader_tag', 'wearewp_add_script_handle', 10, 3 ); | |
function wearewp_add_script_handle( $tag, $handle, $src ) { | |
return str_replace( '<script', sprintf( | |
'<script data-handle="%1$s"', | |
esc_attr( $handle ) | |
), $tag ); | |
} |
View waw-publishing.php
<?php | |
/** | |
Description: Use this script to publish future post by server cron. USE: {site OR sub-site URL}/waw-publishing.php | |
Author: WeAre[WP] | |
Author URI: https://www.wearewp.pro | |
Version: 1.0 | |
CRON | |
wget -O /dev/null https://site-A.com/waw-publishing.php |
View screen-reader-text.css
.screen-reader-text { | |
border: 0; | |
clip: rect(0, 0, 0, 0); | |
height: 1px; | |
overflow: hidden; | |
position: absolute !important; | |
width: 1px; | |
word-wrap: normal !important; | |
} |
NewerOlder