Skip to content

Instantly share code, notes, and snippets.

ウィジェット系の基本

functions.php内に以下のようなコードを追加

register_sidebar( array(
	'name'	=> 'サイドバー',
	'id'	=> 'sidebar001',
	'before_widget' => '<div class="box %2$s">',
	'after_widget' => '</div>',
@sivacchi
sivacchi / wp-body-class.md
Last active August 29, 2015 14:17
WordPressでbody_classで返されるクラス名をまとめてみた

具体的な数字が入っているのは、記事・タグ・カテゴリーのID

ページ名称 クラス名
トップページ body.home.blog
タグ一覧ページ body.archive.tag.tag-template.tag-95
カテゴリ一覧ページ body.archive.category.category-1
記事詳細ページ body.single.single.post.postid-1241.single-format-standard
検索結果一覧ページ body.search.search-results
シングルページ body.page.page-id-2.page-template-default
@sivacchi
sivacchi / gulp-compass-sample.coffee
Created March 12, 2015 10:20
gulp-compassでコンパイル→Pleeeaseでベンダープレフィックス→csscombで整形
gulp.task 'compass', ->
gulp.src '_scss/**/*.scss'
.pipe compass
config_file : './config.rb'
sass : '_scss/'
css: './public/css/'
fonts: './public/fonts'
image: './public/img'
environment : 'dev'
line_comments: false
@sivacchi
sivacchi / gulp-move-sample.coffee
Last active August 29, 2015 14:16
gulpでPhotoshopのアセットファイルを移動する
gulp = require 'gulp'
gulp.task 'move-image', ->
# フォルダ名は任意で変更する
gulp.src '/filename-assets/*.{jpg,png}'
.pipe gulp.dest 'public/img'
@sivacchi
sivacchi / gulp-zip-sample.coffee
Last active August 29, 2015 14:16
gulp-zipで現在の日付をファイル名に圧縮する
gulp = require 'gulp'
zip = require 'gulp-zip'
gulp.task 'archive', ->
date = new Date()
gulp.src ['public/**/*']
.pipe zip(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + '_' +date.getHours() + '-' + date.getMinutes() + '.zip')
.pipe gulp.dest('dest/')
@sivacchi
sivacchi / boostrap-spacing
Last active August 29, 2015 14:16
Bootstrap utility code
// 余白を追加したり除去する
$devices : ('xs': $screen-xs-min, 'sm': $screen-sm-min, 'md': $screen-md-min, 'lg': $screen-lg-min);
@each $device, $size in $devices {
@media (min-width: $size) {
.mt-#{$device}-0 {
margin-top: 0;
}
.mb-#{$device}-0 {
margin-bottom: 0;
@sivacchi
sivacchi / index.html
Created July 28, 2014 08:28
CSS3 property font-strech test
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>CSS3 font-stretch Test</title>
<style>
p {
font-size: 60px;
font-stretch: condensed;
}
@sivacchi
sivacchi / index.html
Created July 28, 2014 08:21
CSS3 property font-stretch test
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>CSS3 font-stretch Test</title>
<style>
p {
font-family: Futura;
font-stretch: condensed;
}
@sivacchi
sivacchi / Nyaos + nvmw .md
Created July 24, 2014 14:25
Nyaos上からnvmwを使う方法

Nyaos で nvmw (Node Version Manager for Windows) を使う

WindowsのNodeのバージョン管理ソフトを使おうとすると、環境変数を書き換えるためNyaosから参照できない。

$ nvmw use v0.11.13
Now using Node v0.11.13
$ node -v
node No such file or directory
@sivacchi
sivacchi / 0_reuse_code.js
Created March 19, 2014 16:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console