A Table of Content (TOC) generator
Yes, via stylesheet, like so:
.pni-content .toplink { display: none ! important }
Yes, also via stylesheet. For using decimals in all instances (level1, level2, ..):
.pni-navigation ol li { list-style-type: decimal ! important }
Or to use discs (non-numeric), change the style like so:
.pni-navigation ol li { list-style-type: disc ! important }
See http://www.w3schools.com/css/pr_list-style-type.asp for more info
Yes. The following example shows how you can add the TOC as a filter to the_content, which will auto-use the TOC in any of your posts. Therefore add the following at the end of the functions.php file of your theme:
if ( function_exists( 'toc_filter' ) && ! function_exists( 'theme_toc_filter' ) ) {
function theme_toc_filter( $content = "" ) {
return toc_filter( $content );
}
add_filter( 'the_content', 'theme_toc_filter' );
}
If you use other content modifying plugins and your short-codes get messed up, try to adjust the priority higher (eg: add_filter( 'the_content', 'theme_toc_filter', 999 ) or even higher).
If you need to disable the TOC in a single page of your theme, you can define the 'DISABLE_TOC' constant with a true value:
define( 'DISABLE_TOC', true );
Requires: 2.7 or higher
Compatible up to: 3.1.0
Last Updated: 2010-10-28
Downloads: 3,090
Got something to say? Need help?