Skip to content

Instantly share code, notes, and snippets.

View felixarntz's full-sized avatar

Felix Arntz felixarntz

View GitHub Profile
<?php
function yourtheme_meta_schema()
{
if( class_exists( 'WPSEO_Frontend' ) )
{
$wpseo_front = WPSEO_Frontend::get_instance();
$canonical = $wpseo_front->canonical( false );
echo '<link itemprop="url" href="' . esc_url( $canonical, null, 'other' ) . '" />' . "\n";
$metadesc = $wpseo_front->metadesc( false );
@felixarntz
felixarntz / yeopress.sh
Created August 22, 2014 09:16
YeoPress shell script (with plugin installation)
#!/bin/sh
RUN_YEOPRESS=0
if which yo >/dev/null; then
RUN_YEOPRESS=1
else
if which npm >/dev/null; then
sudo npm install -g yo generator-wordpress
RUN_YEOPRESS=1
else
@felixarntz
felixarntz / .yeopress
Last active August 29, 2015 19:19
YeoPress preferences
{
"customDirs": true,
"wpDir": "core",
"contentDir": "app",
"createLocalConfig": true,
"blockExternalRequests": false,
"vagrant": false,
"installTheme": true,
"themeDir": "custom-theme",
"themeType": "git",
@felixarntz
felixarntz / charset-collate.php
Last active December 8, 2015 04:56
WP Charset Collate
<?php
function prefix_get_charset_collate() {
global $wpdb;
$charset_collate = '';
if ( $wpdb->has_cap( 'collation' ) ) {
if ( ! empty( $wpdb->charset ) ) {
$charset_collate = "DEFAULT CHARACTER SET " . $wpdb->charset;
}
if ( ! empty( $wpdb->collate ) ) {
// EDIT THIS
trackLayer=effect("Track Layer Pin")("Layer");
cornerPin=trackLayer.effect("Corner Pin");
// DO NOT EDIT THIS
trackPoint=value
c0=cornerPin("Upper Left").valueAtTime(0);
c1=cornerPin("Lower Left").valueAtTime(0);
c2=cornerPin("Lower Right").valueAtTime(0);
c3=cornerPin("Upper Right").valueAtTime(0);
<html <?php yourtheme_html_schema(); ?> <?php language_attributes(); ?>>
<div id="content" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/WebPageElement">
<p>Some content...</p>
</div>
// EDIT THIS
trackLayer=effect("Einstellungen für Ebenen")("Ebene");
cornerPin=trackLayer.effect("Eckpunkte verschieben");
// DO NOT EDIT THIS
trackPoint=value
c0=cornerPin("Oben links").valueAtTime(0);
c1=cornerPin("Unten links").valueAtTime(0);
c2=cornerPin("Unten rechts").valueAtTime(0);
c3=cornerPin("Oben rechts").valueAtTime(0);
p0=cornerPin("Oben links");
<div itemscope="itemscope" itemtype="http://schema.org/Book">
<span itemprop="name">The Lord of the Rings</span> by <a itemprop="author" href="http://en.wikipedia.org/wiki/Tolkien">J.R.R. Tolkien</a>
</div>