Skip to content

Instantly share code, notes, and snippets.

@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.css
Created October 29, 2017 16:08
子テーマ用css
/*
Theme Name: jstork Child
Template: jstork
*/
@lifoolgh
lifoolgh / waku.css
Created October 17, 2017 16:17
画像に枠を付ける
img.waku {
border:1px solid #dddddd;
}
@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);
}