Skip to content

Instantly share code, notes, and snippets.

@inc2734
Created November 11, 2015 11:25
Show Gist options
  • Save inc2734/5cec8cd2ecfb44fbf6f8 to your computer and use it in GitHub Desktop.
Save inc2734/5cec8cd2ecfb44fbf6f8 to your computer and use it in GitHub Desktop.
Add html using action hook on Habakiri
<?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' ) );
}
/**
* include HTML
*/
public function habakiri_before_entry_content() {
// 子テーマ内にパーツを用意して、下記の関数で読み込みできます。
get_template_part( '...' );
}
}
}
add_action( 'after_setup_theme', 'habakiri_child_theme_setup' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment