-
-
Save inc2734/5cec8cd2ecfb44fbf6f8 to your computer and use it in GitHub Desktop.
Add html using action hook on Habakiri
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' ) ); | |
} | |
/** | |
* 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