Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>localhost.homebrew-upgrade</string>
<key>ProcessType</key>
<string>Background</string>
<key>ProgramArguments</key>
<array>
@y-krn
y-krn / functions.php
Last active December 9, 2016 09:05
AMP Custom Template
<?php
add_filter( 'amp_post_template_file', function ( $file, $type, $post ) {
if ( 'single' === $type ) {
$file = dirname( __FILE__ ) . '/include/amp/single.php';
}
return $file;
}, 10, 3 );
?>
@y-krn
y-krn / functions.php
Created December 9, 2016 09:04
AMP Custom Stylesheet
<?php
add_action( 'amp_post_template_css', function() {
?>
// Your style sheet here.
<?php
} );
?>
@y-krn
y-krn / fontawesome.css
Last active February 15, 2018 12:53
AMP Font Awesome Custom CSS
@font-face {
font-family: 'FontAwesome';
src: url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font-family: FontAwesome;
@y-krn
y-krn / single.php
Created December 9, 2016 09:16
AMP Custom Template Single.php
<!doctype html>
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php do_action( 'amp_post_template_head', $this ); ?>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<style amp-custom>
<?php $this->load_parts( array( 'style' ) ); ?>
<?php do_action( 'amp_post_template_css', $this ); ?>
@y-krn
y-krn / functions.php
Last active December 9, 2016 10:09
AMP Custom Google Analytics
<?php
add_filter( 'amp_post_template_analytics', function ( $analytics ) {
if ( ! is_array( $analytics ) ) {
$analytics = array();
}
// https://developers.google.com/analytics/devguides/collection/amp-analytics/
$analytics['xyz-googleanalytics'] = array(
'type' => 'googleanalytics',
'attributes' => array(),