This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function amp_link_tag(){ | |
$content = apply_filters('the_content', get_post_field('post_content', get_the_ID())); | |
$no_amp_a8ad = preg_match('/<a.*?href="https:\/\/px\.a8\.net/is', $content); | |
if(is_singular('post') && is_mobile() && !$no_amp_a8ad){ | |
$amp_param = '?amp=1'; | |
echo '<link rel="amphtml" href="'.esc_url(get_permalink()).$amp_param.'">'."\n"; | |
} | |
} | |
add_action('wp_head','amp_link_tag'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ヘッドタグにampのURLを表示する関数 | |
function amp_link_tag(){ | |
// 例えばA8.netのアフィリエイトがあるページはAMP表示しない場合 | |
// 記事の投稿情報をとってくる | |
$content = apply_filters('the_content', get_post_field('post_content', get_the_ID())); | |
// preg_matchで$content内のA8のURLをマッチングさせる | |
$no_amp_a8ad = preg_match('/<a.*?href="https:\/\/px\.a8\.net/is', $content); | |
// ここに複数条件を入れる | |
// 記事ページだけ表示する |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<!-- AMPページのURLを記載したリンクタグ例 --> | |
<link rel="amphtml" href="https://example.com/post/?amp=1"> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(is_amp()) { | |
// こちらがAMPがONのとき(パラメータに?amp=1がついているとき) | |
} else { | |
// こちらがAMPがOFFのとき(パラメータがない、もしくは?amp=1じゃないとき) | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// AMPページの判断 | |
function is_amp() { | |
if(isset($_GET['amp']) && $_GET['amp'] == 1){ | |
return true; | |
} else { | |
return false; | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// テーマの更新通知確認 | |
require 'plugin-update-checker-4.8.1/plugin-update-checker.php';// ←バージョンは自分のダウンロードしたやつに合わせてください | |
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( | |
// ↓jsonファイルを置いた場所 | |
'https://example.com/theme-update.json', | |
__FILE__, | |
'minamino' // テーマの名前 | |
); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
/*--------------------------------------------------------- | |
Theme Name: minamino | |
Theme URI: https://example.com/download/minamino/ | |
Description: Wordpressテーマの説明 | |
Author: 作者名 | |
Author URI: 著者のサイトURL | |
License:著作権ライセンス | |
License URI:ライセンスのURL | |
Tags:検索向けのタグ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.1.3", | |
"details_url": "https://example.com/", | |
"download_url": "https://example.com/download/minamino.zip" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML構造とclass名を守る--> | |
<div class="swiper-container"> | |
<div class="swiper-wrapper"> | |
<!-- ここに表示したいスライド(これは3枚分) --> | |
<div class="swiper-slide">スライド 1</div> | |
<div class="swiper-slide">スライド 2</div> | |
<div class="swiper-slide">スライド 3</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//swiper.js | |
//jQuery使ってます.. | |
$(document).ready(function () { | |
// swiperをイニシャライズ | |
var mySwiper = new Swiper ('.swiper-container', { | |
// オプションのパラメーターを指定 | |
direction: 'horizontal', | |
effect: "flip", | |
loop: true, | |
spaceBetween: 30, |
NewerOlder