Skip to content

Instantly share code, notes, and snippets.

@heygrady
heygrady / final.css
Created May 27, 2012 19:56
Adaptive Images with CSS
/* place these styles in your global stylesheet */
.image {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
*vertical-align: auto;
font: 0/0 serif;
text-shadow: none;
color: transparent;
@glueckpress
glueckpress / hallo-welt.md
Last active February 10, 2016 10:58
Hallo Welt!

Hallo Welt!

Read in English

Sergej Müller hat seinen Abschied von WordPress angekündigt. Damit seine hochgeschätzten freien Plugins nicht verschwinden, haben wir zu diesem Zweck ein Team gebildet. Wichtig ist uns, die Datenschutz-Konformität der Plugins zu erhalten und eine kommerzielle Nutzung der Domains zu verhindern.

Mit mehreren Personen aus der deutschsprachigen Community führen wir die 11 freien Plugins weiter. Dies sind im Einzelnen:

@scottopolis
scottopolis / wp-api-custom-taxonomies.php
Created October 27, 2015 22:27
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
@sergejmueller
sergejmueller / goodbye-wordpress.md
Last active July 13, 2016 11:19
Goodbye, WordPress!

Goodbye, WordPress!

Fast 9 Jahre und nahezu 3 Millionen Downloads später ist Schluss.
Schluss mit WordPress.

Für mich geht ein Lebensabschnitt zu Ende. Ein Lebensabschnitt, der unendlich viel Erfahrung, Learnings und Spaß mit sich brachte. Ein Lebensabschnitt, der aber unendlich viel Zeit, Nerven und Motivation mit sich nahm. Doch der Wille zählt und ich hoffe stark, dass meine Software und mein Engagement die WordPress-Community ein Stückchen besser, qualitativer gemacht haben.

// Bitteschön

@ultimatemember
ultimatemember / gist:962dcd6eaa6db560f6c7
Last active January 26, 2018 01:18
Sync UM / WP User Role During User Approval
/* This example syncs both UM / WP role during user approval */
add_action('um_after_user_is_approved', 'sync_um_and_wp_role', 99 );
function sync_um_and_wp_role( $user_id ) {
// Get UM role
$role = get_user_meta( $user_id, 'role', true );
// Set WordPress role for same user
$wp_user_object = new WP_User( $user_id );
@ultimatemember
ultimatemember / gist:296161825d8127fa28fc
Last active February 28, 2018 15:59
Stop registration if customer_code field does not equal ABCDE
add_action('um_submit_form_errors_hook', 'check_customer_code', 100 );
function check_customer_code( $args ){
if ( isset( $args['customer_code'] ) && $args['customer_code'] != 'ABCDE' )
exit( wp_redirect( add_query_arg('err', 'invalid_customer_code') ) );
}
@hostz-frank
hostz-frank / functions.php
Last active March 13, 2018 11:05
Im Divi-Theme das Laden externer Google-Fonts abschalten. / Disable external pulled web fonts from Google for the Divi theme
<?php
// Copy the code below into your Divi child(!) theme's functions.php
/**
* Disable external font load from Google.
*
* Useful after putting Google fonts on your own server;
* see https://google-webfonts-helper.herokuapp.com/fonts
*/
@ultimatemember
ultimatemember / gist:08c7f3369f49021cb749
Last active April 4, 2018 14:20
How to stop registration using Ultimate Member action hooks
/*
You need to hook into um_submit_form_errors_hook with a
priority over 10.
You can stop registration here if the customer_code field does not
match the value you want "ALLOWED_VALUE" in this example
*/
@felixarntz
felixarntz / wp-alignment-classes.css
Created November 24, 2017 15:52
New WordPress alignment classes introduced by Gutenberg
/* -------------------------------------------------------------
# Variables
------------------------------------------------------------- */
$site_maxwidth: 72rem; // Maximum width the entire site should not exceed
$site_maxwidth-text: 40rem; // Maximum width the main content text should not exceed
$spacing_horizontal: 1rem; // General horizontal padding
/* -------------------------------------------------------------
# General Styles
@jeffsebring
jeffsebring / responsive_wordpress.css
Created April 1, 2012 05:43
Responsive WordPress Core Theme Styles
/**
* Responsive WordPress Core Theme Styles
* http://jeffsebring.com/responsive-wordpress-images/
--------------------------------------------------- */
.sticky,
.bypostauthor,
.gallery-caption {
display: normal;
}