Skip to content

This WordPress plugin integrates a customizable Table of Contents (TOC) with Rank Math SEO, supporting shortcode insertion, extensive styling options, and automatic 'SiteNavigationElement' Schema generation for improved search visibility.

Notifications You must be signed in to change notification settings

hansvangent/WordPress-Table-of-Contents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

WordPress Table of Contents

This WordPress function integrates a customizable Table of Contents (TOC) with Rank Math SEO, supporting shortcode insertion, extensive styling options, and automatic 'SiteNavigationElement' Schema generation for improved search visibility. It can be loaded straight from your theme, without the need to install a plugin.

Features

  • Shortcode Driven: Insert [toc] in your posts/pages for an automatic TOC.
  • Extensive Customization:
    • Adjust width, font size, background, and more.
    • Exclude specific headings or use patterns to exclude ranges.
    • Enable hierarchical view or number list styles.
    • Smooth scroll with customizable offset for better navigation.
  • SEO Enhancement: Integrates with Rank Math to generate SiteNavigationElement Schema.

Quick Start

  1. Clone this repository into your WordPress theme's directory.
  2. Add the class to your theme's functions.php:
require_once get_template_directory() . '/inc/usergrowth-toc.php';
new TableOfContents();

If you're using a child theme use the following code:

require_once get_stylesheet_directory() . '/inc/usergrowth-toc.php';
new TableOfContents();

Usage

After installation, simply insert the [toc] shortcode wherever you need a TOC. The shortcode will generate a TOC styled according to the customizations defined in the class while adhering to font styles and colors set in your theme.

Get Help

Contribute

Issues

For a bug report, bug fix, or a suggestion, please feel free to open an issue.

Pull request

Pull requests are always welcome, and I'll do my best to do reviews as quickly as possible.

About

This WordPress plugin integrates a customizable Table of Contents (TOC) with Rank Math SEO, supporting shortcode insertion, extensive styling options, and automatic 'SiteNavigationElement' Schema generation for improved search visibility.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages