Skip to content

Instantly share code, notes, and snippets.

View kjy112's full-sized avatar

K.J Ye kjy112

View GitHub Profile
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup {
background: #fff;
clear: left;
font: 14px Helvetica, Arial, sans-serif;
}
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="https://kjye.us2.list-manage.com/subscribe/post?u=38dcdbcb0503681c23642ba69&amp;id=c6bd6154a9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<?php
/*
* Adding actual Google Analytics
*/
add_action( 'amp_post_template_footer', 'xyz_amp_add_analytics' );
function xyz_amp_add_analytics() {
?>
<amp-analytics type="googleanalytics" id="analytics1">
<script type="application/json">
@kjy112
kjy112 / gist:867a39d3aab808026d56
Created February 24, 2016 23:31
Add Analytics Script to Head
<?php
/*
* Adding Google Analytics AMP Head
*/
add_action('amp_post_template_head', 'xyz_amp_google_analytics_head');
function xyz_amp_google_analytics_head(){
?>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<?php
@kjy112
kjy112 / gist:95963479037e01aa5946
Created February 24, 2016 23:31
Code for Logo Only
<?php
add_action( 'amp_post_template_css', 'xyz_amp_additional_css_styles' );
function xyz_amp_additional_css_styles( $amp_template ) {
// only CSS here please...
?>
nav.amp-wp-title-bar {
padding: 12px 0;
background: #000;
}
@kjy112
kjy112 / gist:fb9278133ebe55803c46
Created February 24, 2016 23:29
Code for Styling AMP Header Bar and Text
<?php
/*
* Custom CSS for AMP
*/
add_action( 'amp_post_template_css', 'xyz_amp_my_additional_css_styles' );
function xyz_amp_my_additional_css_styles( $amp_template ) {
// only CSS here please...
?>
nav.amp-wp-title-bar{