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 habakiri_child_theme_setup() { | |
class Habakiri extends Habakiri_Base_Functions { | |
public function __construct() { | |
parent::__construct(); | |
add_action( 'habakiri_theme_mods_defaults', array( $this, 'habakiri_theme_mods_defaults' ) ); | |
} | |
/** |
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 habakiri_child_theme_setup() { | |
class Habakiri extends Habakiri_Base_Functions { | |
public function __construct() { | |
parent::__construct(); | |
// habakiri_before_entry_content フックにフックさせる場合 | |
add_action( 'habakiri_before_entry_content', array( $this, 'habakiri_before_entry_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
<?php | |
function habakiri_child_theme_setup() { | |
class Habakiri extends Habakiri_Base_Functions { | |
public function __construct() { | |
parent::__construct(); | |
add_action( 'init', array( $this, 'register_post_types' ) ); | |
} | |
/** | |
* カスタム投稿タイプを定義 |
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
<section class="jumbotron section-image section-fixed" style="background-image: url( hoge.jpg )"> | |
<div class="containter text-center"> | |
<div class="row"> | |
<div class="col-md-8 col-md-offset-2"> | |
<h1>Habakiri</h1> | |
This section has classes, jumbotron, section-image and section-fixed. If you attach the .btn-default, displaying beautiful. | |
<div class="col-md-8 col-md-offset-2"> | |
<a class="btn btn-default btn-block">CONTACT</a> |
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 | |
/** | |
* カスタムフィールドを定義 | |
* | |
* @param array $settings Smart_Custom_Fields_Setting オブジェクトの配列 | |
* @param string $type 投稿タイプ or ロール | |
* @param int $id 投稿ID or ユーザーID | |
* @param string $meta_type post | user | |
* @return array | |
*/ |
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
$( '<img />' ).one( 'load', function() { | |
// do something | |
} ).attr( 'src', $( 'img#hoge' ).attr( 'src' ) ); |
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 | |
class Hoge { | |
/** | |
* get_the_post_thumbnail | |
* @param string $size | |
* @param array $attributes | |
* @return string | |
*/ | |
public static function get_the_post_thumbnail( $size = 'post-thumbnail', array $attributes = array() ) { | |
if ( has_post_thumbnail() ) { |
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 | |
/** | |
* get_second_directory | |
*/ | |
function get_second_directory() { | |
if ( $_SERVER['REQUEST_URI'] ) { | |
$home_url = home_url(); | |
$home_url = explode( '/', $home_url ); | |
$REQUEST_URI = $_SERVER['REQUEST_URI']; | |
$REQUEST_URI = preg_replace( '/^(.*)?\?.*$/', '$1', $REQUEST_URI ); |
NewerOlder