WordPress jQuery Table of Contents plugin

A Tech article with View Comments posted 10 January 2010.
Tags: , ,

I’m proud to announce my first WordPress plugin, “jQuery Table of Contents,” which inserts the lovely little table of contents you see on many of the pages of my website. It uses jQuery to inspect the content of your post or page and generate table of contents links based on the header tags. It’s easy, SEO friendly, and highly customizable.

Download


Download from WordPress Extend

Is this plugin helping you make money? Buy me a cup of coffee!


Installation

  1. Upload `jquery-toc.php`, `jquery-toc.css`, and `jquery-toc.js` to the `/wp-content/plugins/jquery-toc/` directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Important! – Configure the Table of Contents to customize it for your theme.

Demo

You’re looking at it. This site has a working example of the plugin. Look at the pink box in the top-right corner of this post.

Frequently Asked Questions

Q: Does this plugin work automatically for every theme?

A: Nope. The default settings provided will work out the box for the WordPress Default (Kubric) theme. Beyond that, you may have to change settings to get it to work with your theme.

Changelog

  • 1.0 – First public release

View Comments to “WordPress jQuery Table of Contents plugin”

  1. May I ask why you created this if SEO Table Of Contents already exists and is pretty mature? http://hackadelic.com/solutions/wordpress/toc-boxes

    I’m all for new plugins, of course, but can you tell us how it is different, other than that it uses jQuery vs PHP? Is there any benefit in doing so, other than saving server time?

    Thanks.

    • Artem – Thanks for your question. I can think of a number of advantages. Besides saving server time, my plugin:

      1. Doesn’t insert the TOC into the html of the document, which makes for cleaner markup.
      2. Simpler to configure to get a usable TOC out of the box.
      3. Inserts automatic links back to the top of the document.

      It also has some technical merits that I think are worth considering:

      1. Doesn’t try to parse HTML with PHP. Web browsers and Javascript are designed to handle manipulating the DOM already, so I think it’s a superior tool.
      2. Much simpler PHP plugin code means that there is less to break in future PHP and WordPress upgrades.

      SEO Table of Contents isn’t a bad plugin at all, and if it meets your needs, please use it. But if all you want is a simple table of contents that you don’t have to think much about, my plugin fits that niche pretty nicely.

  2. RavanH says:

    Hi, will you be hosting this plugin on WordPress Extend?

  3. [...] WordPress jQuery Table of Contents plugin | Ted Carnahan Plugin de WordPress para generar tabla de contenido automática con jQuery. Especial para posts largos. (tags: wordpress plugin jquery javascript content index tables) [...]

  4. [...] Artem Russakovskii, who has also contributed to the development of SEO Table Of Contents, has recently asked that question out loud at the youngest offspring in the TOC plugin familly, the WordPress jQuery Table of [...]

  5. RavanH says:

    Excellent! Could you pllease let me know when that happens and post a link? I have subscribed to these comments…

  6. [...] people are willing to tell you publicly that they don’t like it. Such is the case with my WordPress plugin, jQuery Table of Contents. Zoran at Hackadelic, author of a similar plugin, Hackadelic SEO Table of Contents, likes the clean [...]

  7. [...] WordPress jQuery Table of Contents plugin | Ted Carnahan Plugin de WordPress para generar tabla de contenido automática con jQuery. Especial para posts largos. (tags: wordpress plugin jquery javascript content index tables) [...]

  8. It would be great if you could share some screenshots or a live demo of the plugin? I would like to see the implementation before I start using it.

  9. Dan says:

    I wonder if SEO Table of Contents does anything for SEO or is just another marketing device as if it did do something for SEO.

    What I am having a problem with is the placement of the TOC box (mine shows up above the title for some reason and breaks up the post without wrap) and it doesn't appear in most of my posts – only some, not others. Can't figure out why that is.

  10. I think SEO Table of Contents does do things well – it adds “bookmark nofollow” to the links, so you don't get a penalty for spaminess, it's list-based, and it adds good title attributes to its links. It certainly won't hurt your SEO.

    Is the trouble you're having with SEO Table of Contents or with jQuery TOC? Perhaps you can post a link to where the graphical issues are happening, or a link to a screenshot? An email to me would be fine, too.

Leave a Reply

blog comments powered by Disqus