Skip to content

Instantly share code, notes, and snippets.

<ul id="app">
<li v-for="(item,index) in items">
<img v-bind:src="item.snippet.thumbnails.high.url">
<span class="title">{{ item.snippet.title }}</span>
</li>
</ul>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
<div id="app">
<input type="text" v-model="search_query" placeholder="文字を入力してください">
<ul>
<li v-for="album in filterAlbum">
{{ album }}
</li>
</ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
<div id="app">
<p>メッセージ: {{ message }} </p> <input v-model="message" placeholder="入力してください">
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
new Vue({
el: '#app',
data: {
message: ''
<amp-analytics type="googleanalytics" id="analytics1">
<script type="application/json">
{
"vars": {
"account": "UA-XXXXX-Y"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<?php do_action( 'amp_post_template_head', $this ); ?>
<style amp-custom>
<?php $this->load_parts( array( 'style' ) ); ?>
<?php do_action( 'amp_post_template_css', $this ); ?>
function add_ad_before_h2_for_3times($the_content) {
//広告(AdSense)タグを記入
$ad = <<< EOF
<div style="padding:15px 0px">
<p>スポンサードリンク</p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 記事中 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXX"
<article class="amp-wp-article">
<header class="amp-wp-article-header">
<h1 class="amp-wp-title"><?php echo wp_kses_data( $this->get( 'post_title' ) ); ?></h1>
<!--記事タイトル下-->
<div>
<p>スポンサードリンク</p>
<amp-ad
type="adsense"
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<?php do_action( 'amp_post_template_head', $this ); ?>
<style amp-custom>
<?php $this->load_parts( array( 'style' ) ); ?>
<?php do_action( 'amp_post_template_css', $this ); ?>
</style>
@webloglife
webloglife / 埋込例
Created December 2, 2016 13:14
amp-social-share3
<div class="amp-wp-article-content">
<?php echo $this->get( 'post_amp_content' ); // amphtml content; no kses ?>
<div>
<amp-social-share type="twitter"></amp-social-share>
<amp-social-share type="gplus"></amp-social-share>
<amp-social-share type="facebook"
data-param-app_id="(FacebookのAPP ID)"></amp-social-share>
</div>
</div>
@webloglife
webloglife / ボタン
Created December 2, 2016 13:01
amp-social-share2
<div>
<amp-social-share type="twitter"></amp-social-share>
<amp-social-share type="gplus"></amp-social-share>
<amp-social-share type="email"></amp-social-share>
<amp-social-share type="pinterest"></amp-social-share>
<amp-social-share type="linkedin"></amp-social-share>
<amp-social-share type="facebook"
data-param-app_id="(FacebookのAPP ID)"></amp-social-share>
</div>