Skip to content

Instantly share code, notes, and snippets.

@lifoolgh
lifoolgh / attachment_404.php
Last active October 17, 2017 16:18
attachmentページでステータス404を返す
// attachmentページでステータス404を返す
add_action( 'template_redirect', 'status404' );
function status404() {
// attachmentページだった場合
if ( is_attachment() ) {
global $wp_query;
$wp_query->set_404();
status_header(404);
}
@lifoolgh
lifoolgh / waku.css
Created October 17, 2017 16:17
画像に枠を付ける
img.waku {
border:1px solid #dddddd;
}
@lifoolgh
lifoolgh / style.css
Created October 29, 2017 16:08
子テーマ用css
/*
Theme Name: jstork Child
Template: jstork
*/
@lifoolgh
lifoolgh / functions.php
Created October 29, 2017 16:40
子テーマ用functions.php
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style'));
}
@lifoolgh
lifoolgh / style-test-font.css
Created October 30, 2017 03:33
子テーマのテスト用CSS
body {
font-family: '游明朝', YuMincho, 'HG明朝E', 'MS P明朝';
}
@lifoolgh
lifoolgh / stork-quicktag.php
Last active November 1, 2017 05:06
STORKのショートコード用クイックタグ
// カスタムクイックタグ
if ( !function_exists( 'add_quicktags_to_text_editor' ) ):
function add_quicktags_to_text_editor() {
//スクリプトキューにquicktagsが保存されているかチェック
if (wp_script_is('quicktags')){?>
<script>
QTags.addButton('qt-box-blue','青ボックス','[box class="blue_box" title="ここにタイトル"]','[/box]');
QTags.addButton('qt-box-red','赤ボックス','[box class="red_box" title="ここにタイトル"]','[/box]');
QTags.addButton('qt-box-yellow','黄ボックス','[box class="yellow_box" title="ここにタイトル"]','[/box]');
QTags.addButton('qt-box-green','緑ボックス','[box class="green_box" title="ここにタイトル"]','[/box]');
@lifoolgh
lifoolgh / qt-marker.php
Last active November 1, 2017 04:28
マーカーのクイックタグ追加
            QTags.addButton('qt-marker-blue','マーカー(青)','<span class="marker_blue">','</span>');
            QTags.addButton('qt-marker-red','マーカー(赤)','<span class="marker_red">','</span>');
QTags.addButton('qt-marker-orange','マーカー(オレンジ)','<span class="marker_orange">','</span>');
@lifoolgh
lifoolgh / marker.css
Created November 1, 2017 04:30
マーカーのCSS
/* 青マーカー */
.marker_blue {
background: linear-gradient(transparent 70%, #66ccff 40%);
}
/* 赤マーカー */
.marker_red {
background: linear-gradient(transparent 70%, #ff7f7f 40%);
}
/* オレンジマーカー */
.marker_orange {
@lifoolgh
lifoolgh / header-gist-embed.php
Created November 7, 2017 05:14
gist-embed.min.jsを読み込む
<script src="/gist-embed.min.js"></script>
@lifoolgh
lifoolgh / gist-height.css
Last active November 7, 2017 06:45
gistを埋め込んだときの高さ指定
.gist-data {
max-height: 400px;
}