Skip to content

Instantly share code, notes, and snippets.

@Shitsu
Shitsu / class-widget-template.php
Last active April 11, 2017 02:39
[WordPress]ウィジェット作成用のテンプレート
<?php
/**
* Class Widget_Template
*/
class Widget_Template extends WP_Widget {
/**
* Widget_Template コンストラクタ
*/
@Shitsu
Shitsu / the-new-label.php
Last active March 3, 2017 09:40
[WordPress]公開日・更新日を元に記事に「New」ラベルを表示する (記事はこちら: https://increment-log.com/wordpress-display-new-label/
<?php
/**
* 記事の公開、更新日に合わせて「New」ラベルの表示
*
* @param int $days 公開(更新)されてからラベルを表示する日数
* @param string $label_text ラベルに表示するテキストを指定
* @param string $class クラス名を指定
* @param string $date_type ラベルの表示条件が公開日なら'release'、更新日なら'modified'
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
*/
@Shitsu
Shitsu / _search-form.scss
Last active March 28, 2017 02:26
[Sass, WordPress]レスポンシブ対応の検索フォームにする(CSS版はこちら https://increment-log.com/wordpress-search-form-responsive-sass-css/
.search-form {
$height: 48px;
$font-size: 16px;
$input-border-color: #ccc;
$button-text-color: #fff;
$button-background-color: #2f78d0;
$transition-list: all 0.3s ease-in-out;
overflow: hidden;
clear: both;
@Shitsu
Shitsu / breadcrumb.php
Last active April 22, 2019 10:08
[WordPress]パンくずナビゲーションの関数
<?php
/**
* パンくずナビゲーションを出力します。
*
* @param array $args {
* オプションです。パンくずリストの出力を配列型の引数で変更できます。
*
* @type string $container パンくずリスト囲むタグを指定。デフォルトは'div'。
* @type string $container_class パンくずリストを囲むタグのClassを指定。デフォルトは'breadcrumb-section'。
* @type string $container_id パンくずリストを囲むタグのIDを指定。デフォルトは無し。
@Shitsu
Shitsu / 0_reuse_code.js
Last active August 29, 2015 14:12
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
@Shitsu
Shitsu / csscomb-config.json
Created October 17, 2014 12:46
CSSComb setting JSON file
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"quotes": "double",