Created
October 28, 2018 10:07
-
-
Save yhira/b5bb4aabbbbbebb50a67d93fbb164609 to your computer and use it in GitHub Desktop.
Cocoonの目次部分を2カラムにする
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_filter( 'get_toc_tag', get_toc_tag_custom, 10, 3 ); | |
if ( !function_exists( 'get_toc_tag_custom' ) ): | |
function get_toc_tag_custom($html, &$harray, $is_widget){ | |
if ($is_widget) { | |
return $html; | |
} | |
ob_start();?> | |
<div class="column-wrap column-2"> | |
<div class="column-left"> | |
<?php echo $html; ?> | |
</div> | |
<div class="column-right"> | |
<img src="https://wp-cocoon.com/wp-content/uploads/2018/03/screenshot.jpg" alt="挿入する画像"> | |
</div> | |
</div> | |
<?php | |
$html = ob_get_clean(); | |
return $html; | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment