Last active
March 12, 2021 13:50
-
-
Save rocket-martue/b38fcc0788e049e479f4f6b0fc14bc2d to your computer and use it in GitHub Desktop.
Snow Monkey で、フック (snow_monkey_append_main) を使ってページ下部に再利用ブロックを表示する。
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
add_action( | |
'snow_monkey_append_main', | |
function() { | |
$reuse_block = get_post( $id ); // $id は、再利用ブロックのID | |
echo apply_filters( 'the_content', $reuse_block->post_content ); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$id は、再利用可能ブロックの管理ページを開き、編集画面に入ると、URLの中にIDがある。