Last active
June 26, 2016 08:45
-
-
Save wprs/1f8f9b0d60b33b9ff073a423f04a07da to your computer and use it in GitHub Desktop.
Use shortcode to display Table Of Content Plus on WPRichSnippets enabled posts https://wprichsnippets.com/doc/table-content-plus/
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_filter('wprs_box', 'wprs_add_toc_4321'); | |
/* | |
Use shortcode to display Table Of Content | |
This is a simple fix for Table Of Content Plus Plugin | |
*/ | |
function wprs_add_toc_4321($box) { | |
if ( shortcode_exists( 'toc' ) ) { | |
$toc = do_shortcode('[toc wrapping="left"]'); | |
$box = $box .$toc; | |
} | |
return $box; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment