My website is a pure content based website, where information is present on different pages. Though I use wordpress, I have modified it to be a static website and not a blog. In my pages, I use only h2 tags for headings (h1 for the main title). I have decided to add a "Table of contents" at the top of every page so that users will find it easy to understand what information is present on the page. The problem is that I don't want to manually add the table of contents on each page because I know PHP can easily do it for me. But, I don't know PHP that well so I am dependent on other people's work. I recently installed a plugin called "table of contents plus" to my wordpress. It was nice and had a huge set of options and it did the job but the problem is that I don't want that much complexity. I don't want to run scripts that I am never going to use. So I have decided to make one myself. I hope you people will help me make my own script. What I need the script to do is: 1) Read all the h2 tags on the page and store them as array 2) Just above each h2 tag, add an anchor to which users can come when they click the respective link in the table of conents at the top of the page. 3) Create a div with a specific class (so that it can be styled) and add the text from the h2 tags as separali lines and convert them to links that point to respective locations. Thats' it. I don't need any fancy javascript, or other PHP additions. I want it as simple as possible.
This script is not simple. It will be difficult for you to find someone who will made it for free. Just keep using the plugin.
As modz said it wont be simple to develop. I checked the plugin you mentioned, it seems to be what you need and doesn't contain extra features or code that you wont need. You can also contact the plugin developers via the link provided at the end of the plugin page if you need to know how to set the CSS style from the code.
I can change the CSS styles of the table of contents created by the plugin. That is not the problem. The problem, in my thinking is that the code of the plugin contains too much extra stuff. For instance, there is a javascript for smooth scrolling and other jqueries for other stuff that I don't understand. I think that these would be an extra burden on my website's loading speeds. That is why I want to get rid of these. The code of the plugin is so complex that I haven't even tried to edit it to remove the extra stuff because I don't understand even the basic theme of how it works. Am I wrong in my assumption that the extra stuff that I am never going to use will be a burden on page loading speeds? I have a simple website and I want it to be fast. There is no point in having a simple website and then adding stuff that won't add much value but slow the website down. That's what I think and may not be necessarily true.