Skip to content

Instantly share code, notes, and snippets.

@yhira
Created October 28, 2018 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yhira/b5bb4aabbbbbebb50a67d93fbb164609 to your computer and use it in GitHub Desktop.
Save yhira/b5bb4aabbbbbebb50a67d93fbb164609 to your computer and use it in GitHub Desktop.
Cocoonの目次部分を2カラムにする
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