Skip to content

Instantly share code, notes, and snippets.

@wprs
Last active Jun 26, 2016
Embed
What would you like to do?
Use shortcode to display Table Of Content Plus on WPRichSnippets enabled posts https://wprichsnippets.com/doc/table-content-plus/
<?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