Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

netzgestaltung

🏠
Working from home
View GitHub Profile
@netzgestaltung
netzgestaltung / OpenSans.css
Last active Apr 9, 2020 — forked from sbp/OpenSans.css
CSS for Open Sans
View OpenSans.css
/**
* CSS for Open Sans
* =================
* @Install
* https://google-webfonts-helper.herokuapp.com/fonts/open-sans?subsets=latin
* use modern browser option and subsets you need
* download fonts and upload to your themes font directory
* add the CSS on top of you stylesheet and edit the paths to the current version and relative path of your themes font directory
*
* @Usage
@netzgestaltung
netzgestaltung / responsive-video.css
Last active Nov 18, 2019 — forked from jaicab/responsive-video.css
Pure CSS solution for embed videos with an aspect ratio of 16:9
View responsive-video.css
.content figure.video {
position: relative;
padding-bottom: 56.25%; /*16:9*/
}
.content figure.video > video,
.content figure.video > iframe,
.content figure.video > object,
.content figure.video > embed {
position: absolute;
@netzgestaltung
netzgestaltung / gist:89bd90c9c743a0ee2da55998c9840d36
Created Nov 8, 2019 — forked from jaredatch/gist:3764391
Redirect taxonomy to use archive template
View gist:89bd90c9c743a0ee2da55998c9840d36
<?php
/**
* Redirect taxonomy to use custom post type archive template
*
* @author Jared Atchison
* @link http://jaredatchison.com/code/
* @param string $template
* @return string
*/
function ja_template_redirect( $template ) {
@netzgestaltung
netzgestaltung / admin.js
Last active Oct 25, 2017 — forked from zerosignalproductions/admin.js
Insert an image into the wordpress editor always wrapped in a figure tag. The javascript is used to remove the figure element from the editor if the delete button is used. Editing alingnment left/right/center/none is supported.
View admin.js
(function($) {
$(document).ready(function() {
$('body').on('mousedown', 'div[aria-label="Remove"]', function(e) {
var editor = tinyMCE.activeEditor,
element = editor.selection.getNode();
if(element.tagName !== 'FIGURE') {
$(element).parents('figure').remove();
}
});
View wf_wp_content_excerpt
<?php
/**
* @description Echoes custom the_excerpt from any post id. the_excerpt is 7 words long as default
*
* @arguments mixed
* @param array $arguments default NULL array of arguments - the below mentioned + $limit
* @param int $post_id default NULL the id of the post, if null, the current post is taken
* @param string $cut default '...' when nothing setted it will take the current Postcontent from loop and excerpt it
*/
You can’t perform that action at this time.