Table of Contents Plus

A powerful yet user friendly plugin that automatically creates a context specific index or table of contents (TOC) for long pages (and custom post types). More than just a table of contents plugin, this plugin can also output a sitemap listing pages and/or categories across your entire site.

Description

Built from the ground up and with Wikipedia in mind, the table of contents by default appears before the first heading on a page. This allows the author to insert lead-in content that may summarise or introduce the rest of the page. It also uses a unique numbering scheme that doesn’t get lost through CSS differences across themes.

This plugin is a great companion for content rich sites such as content management system oriented configurations. That said, bloggers also have the same benefits when writing long structured articles. Discover how Google uses this index to provide ‘Jump To’ links to your content.

Includes an administration options panel where you can customise settings like display position, define the minimum number of headings before an index is displayed, other appearance, and more. For power users, expand the advanced options to further tweak its behaviour – eg: exclude undesired heading levels like h5 and h6 from being included; disable the output of the included CSS file; adjust the top offset and more. Using shortcodes, you can override default behaviour such as special exclusions on a specific page or even to hide the table of contents altogether.

Prefer to include the index in the sidebar? Go to Appearance > Widgets and drag the TOC+ to your desired sidebar and position.

Custom post types are supported, however, auto insertion works only when the_content() has been used by the custom post type. Each post type will appear in the options panel, so enable the ones you want.

Translations

  • Australian English (default)
  • Dutch – Renee
  • French – Jean-Michel Duriez
  • German – Ben
  • Polish – Jakub
  • Simplified Chinese – icedream
  • Slovak – Boris Gereg
  • Ukrainian – Michael Yunat

Translations are more than welcome. The translation file can be found in the languages folder of the plugin, or online in the WordPress repository.

If you have any advice in making it easier to translate, please let me know.

Screenshots

Scenarios / FAQs

The simplest approach

For the impatient, all you have to do is enable the plugin.

The plugin will apply default settings and produce the table of contents before the first heading on pages (not posts, nor custom post types) with four or more headings.

No shortcodes needed.

How do I disable the table of contents for a certain page?

Simply add [no_toc] anywhere on the page to suppress the table of contents.

My site has 100 pages but I only want the table of contents to appear on 10 of them

You could put [no_toc] on the 90 pages but that wouldn’t be fun… so try the following:

  1. Go to Settings > TOC+ and disable the auto insertion option for pages (or the content type you’re working with).
  2. Add [toc] onto the 10 pages that need them. Note that the table of contents will appear where you placed the shortcode.

Alternatively, you could also experiment with the restrict path option if the pages you want to include the index on all fall within a certain section of your site (eg /wiki/).

I want to ignore certain headings

Use the ‘exclude headings’ option if you would like to ignore certain headings. Separate multiple headings with a pipe |. Use an asterisk * as a wildcard to match other text. Note that this is not case sensitive. Some examples:

  • Fruit* ignore headings starting with Fruit
  • *Fruit Diet* ignore headings with Fruit Diet somewhere in the heading
  • Apple Tree|Oranges|Yellow Bananas ignore headings that are exactly Apple Tree, Oranges or Yellow Bananas

Can I have the table of contents in the sidebar?

Use the TOC+ widget and drag it into your desired position. If you want the table of contents to only be displayed in the sidebar, then make sure you tick that option in the widget.

Unlike Wikipedia, I want all my anchors to be lowercase and use hyphens rather than underscores

There are two options that allow you to adjust the casing and use of hyphens. If you still require more, you can massage it a little more by attaching into the toc_url_anchor_target filter. See the developer help section for an example.

I would like to incorporate a sitemap

  1. Create a page for your sitemap (if you have an existing one, use that instead).
  2. Add [sitemap] into your page and save.

The above is the simplest example of integrating a sitemap listing all pages and categories. You can customise the sitemap options under Settings > TOC+ or check out some of the more advanced uses with the sitemap related shortcodes below.

You could also incorporate a sitemap using a text widget and pasting any of the sitemap shortcodes.

Install / upgrade

Install the plugin by searching for Table of Contents Plus from the plugin add menu, or directly from the WordPress plugins repository.

There are no special upgrade instructions (woohoo!). Overwrite your existing folder with the latest or use the streamlined approach in the plugin menu. Your options will not be lost.

Shortcodes

The plugin was designed to be as seamless and painfree as possible and did not require you to insert a shortcode for operation. However, using the shortcode allows you to fully control the position of the table of contents within your page. The following shortcodes are available with this plugin.

When parameters are left out for the shortcodes below, they will fallback to the settings you defined under Settings > TOC+.

[toc]

Lets you generate the table of contents at the preferred position. Also useful for sites that only require a TOC on a small handful of pages.

  • label: text, title of the table of contents
  • no_label: true/false, shows or hides the title
  • wrapping: text, either “left” or “right”
  • heading_levels: numbers, this lets you select the heading levels you want included in the table of contents. Separate multiple levels with a comma. Example: include headings 3, 4 and 5 but exclude the others with heading_levels="3,4,5"
  • exclude: text, enter headings to be excluded. Separate multiple headings with a pipe |. Use an asterisk * as a wildcard to match other text. You could also use regular expressions for more advanced matching.
  • class: text, enter CSS classes to be added to the container. Separate multiple classes with a space.

[no_toc]

Allows you to disable the table of contents for the current post, page, or custom post type.

[sitemap]

Produces a listing of all pages and categories for your site. You can use this on any post, page or even in a text widget.

[sitemap_pages]

Lets you print out a listing of only pages. The following parameters are accepted:

  • heading: number between 1 and 6, defines which html heading to use
  • label: text, title of the list
  • no_label: true/false, shows or hides the list heading
  • exclude: IDs of the pages or categories you wish to exclude
  • exclude_tree: ID of the page or category you wish to exclude including its all descendants

[sitemap_categories]

Similar to [sitemap_pages] but for categories.

[sitemap_posts]

This lets you print out an index of all published posts on your site. By default, posts are listed in alphabetical order grouped by their first letters. There are CSS classes for each section, letter and list allowing you to customise the appearance.The following parameters are accepted:

  • order: text, either ASC or DESC
  • orderby: text, popular options include “title”, “date”, “ID”, and “rand”. See WP_Query for a list
  • separate: true/false, when set to false, does not split the posts by first letter.

Versioning scheme

I have adopted the same Ubuntu versioning scheme so the first release is 1107.

Other releases in the same month will be dot releases, eg the second release in July 2011 is 1107.1.

I love it, how can I show my appreciation?

If you have been impressed with this plugin and would like to somehow show some appreciation, rather than send a donation my way, please donate to your charity of choice. Feel free to leave a short note here if you’d like.

I will never ask for any form of reward or compensation. Helping others achieve their goals is satisfying enough :)

Questions or suggestions?

If you have questions or suggestions, please place them below.

799 thoughts on “Table of Contents Plus”

  1. Hello!

    We just installed your plugin and love it so far! The one problem we’re having is that it’s only finding the “standard” WordPress Categories but not the custom categories or custom Post types our theme uses.

    We’re using the Delicieux Theme (http://themeforest.net/item/delicieux-restaurant-wordpress-theme/3346328) and it has some special Post-type templates called “Food” and “Portfolio”.

    We’d love for those to be listed in our site map so we have a complete list of all of our recipes. Any ideas on how to get this working?

  2. Hey dude,

    need Toc+ for my blabla.org/ page (first/front page)… it shows up on .org/blabla or .org/blubblub but not .org/

    How can i solve this?

    best

    1. There’s an advanced option to enable it for the homepage. Note that it works best if there is only one page or one article being displayed on the homepage.

  3. Hi,
    I love your plugin, but I have one question. I have used the plugin on one of my pages that is in French, but the heading text is in English (Contents). How can I get it to say Contents in French (Table des Matières) on the French pages and Contents on the English pages?. I’m using Polylang and CodeStyling Localization to translate all strings of WordPress and menus in French but can’t seem to find how and where to translate that specific heading text string.
    Can anybody help, please?
    PS : same question for Hide (cacher in French)

    1. Hi – you can use [toc label="Table des Matières"] to get the title changed on French pages, however, the “show” and “hide” isn’t currently customisable via the shortcode. It soon will be though!

  4. Is there a way to enable dropdowns for sublistings? I’d love to use this plugin if I could make the listing of pages (sitemap) more manageable with a dropdown for each level of page.

    1. Yes you would be able to but you’ll need to provide your own javascript to do so. There are enough hooks to target the nested lists to be able to make them toggleable or whatever effect you want to apply. As there are many options, I haven’t added any don’t anticipate that anything like that will be provided. If you want to play, start with something like the following selector to target the nested lists on page sitemaps.

      ul.toc_sitemap_pages_list ul.children

  5. Michael,
    I recently installed your TOC+ plugin and it does a nice job for me. When I get a chance I may be able to provide translation to Czech. Do you know of anyone who is already working on translation to Czech?
    Thanks,
    Petr
    PS: We can discuss this offline via email if you want.

    1. Hi Petr – you’re the first to express an interest in providing a Czech translation so feel free to go ahead should you wish. You can send your files to me on michael at this domain. Thanks

  6. Please forget my last comment, I forgot to activate a checkmark.

    Another suggestion: How is it possible to get fullstops after the mai heading
    At the moment it is
    1 Intro
    2 main
    3 something

    I want it to be:
    1. Intro
    2. main
    3. something

  7. HI, Not really sure why this should be your problem as oppose to the other plugin that does not play nice with it, but I will ask you. I love this plugin but it does not play nice with my Portfolio Slideshow Pro plugin. it breaks the Thumbnail scroll (carousel). please see website example. I currently have your plugin it turned off, but I would love to use it again.

  8. Just started testing this plugin, seems to work well. I like to be very hands on when I’m developing, and I was really excited to see that toc_get_index() was available to call from a theme template. I think it needs some work, however. I want to display the TOC on a custom post type, and I’d like to just call it in my theme via toc_get_index(), so I disabled TOC+ for all of the post types, and called the function in my template where I want it. This doesn’t work, and looking briefly at the code, probably because $tic->is_eligible() returns false for this post type. So my other option is to enable TOC+ for this post type, the problem is that TOC+ automatically inserts, and my function call is redundant. Am I missing something? I think the API needs some way to say “Yes, I know you’re disabled, but I’m calling you here because I REALLY want a TOC at this location”.

    I can probably just use the automatically generated TOC, but my first experience trying to insert a TOC manually was confusing…

    1. Thanks Jonon, that’s great feedback.

      The difficulty is that the_content still needs to be called to allow TOC+ to insert anchor links for headings within the content so the page needs to be ‘eligible’ otherwise you will output the index but they won’t link to any of the headings without those anchors. You are right though, it is confusing and needs to be improved – ideally it should know that the API is being used and then to skip some of those eligibility checks.

  9. Hi I have a question, On one of my pages I have videos. I have the [toc] code on that page but I wanted to break my page into “pages” using the Tag. The table of contents picks up the titles of the videos perfectly BUT after the nextpage tag , It does not let me add another [toc] , because I think the plugin treats it as more then one short code on the same page. Is there anything I can add to fix this?

    example
    page 1 , has 20 videos, and I put the [toc] and only the titles of 1-7 show like it should

    then the next page tag

    then [toc] again I put it for the videos that come after, but nothing shows… Can I make it so I can have more then one on a page ?

  10. Can you confirm that TOC+ works for generating google rich “jump to” snippets? I have none. And even this website doesn’t have google “jump to” results.

    So, do you know if it works with google? Or should I try something else?

    Great plugin :)

  11. I have been using a trick I found to include content from one post into another post. It works fine normally but it seems to screw up the TOC. The code is in a shortcode and is basically this:

    $ip = get_page($id); // $id is the post id
    echo apply_filters(‘the_content’, $ip->post_content);

    When used on a page with [toc] in it it seems to eliminate the normal TOC and create one for the included content at a different place in the output. What I want is for the TOC to cover both the including post and the included post’s contents as though it were present at the point of the include shortcode.

    Any idea why your plugin does this and is there a way to do what I want without messing up the TOC?

    Thanks for a nice plugin!

    1. Sorry, I’ve been thinking about a reply to this for a week now…

      The short answer would be it’s tricky as the plugin operates using the_content filter and can only do what is presented to it. Running multiple queries and providing a combined output to the plugin I believe won’t result in the desired outcome.

      I would suggest for you to edit the query before the_content is fired. That should populate the query object with the data you want. Take a look at the pre_get_post filter with an example.

  12. Hello, may I know if this plugin is working for WordPress 3.6?
    I’ve just installed this script, activated it, and gone through the settings. Unfortunately, TOC doesn’t show up. I’ve read what the Help section suggested by to no avail.

    I tried:
    – autoinsertion page and posts, with >2 headers. My pages and posts meet that criteria.
    – disable autoinsertion, but manually put [toc] in my post/page
    – disable autoinsertion, use widget and check the box to always show in sidebar, put [toc] in my post/page

    TOC never shows up at all. In fact, [toc] remains visible in the published post, suggesting the plugin did not run at all.

    Help please?
    PS Thank you for the awesome plugin. This page demonstrated it perfectly.

    1. Yeah it works with 3.6…

      Did you create your own theme? Is it using the_content? If it was a custom theme, then it sounds like its printing out the content from the DB rather than via the API functions.

  13. Hi!

    I love the TOC plus plugin. Very nice and to the point.

    Are you considering adding a highlight function, that highlights in the TOC where you are on the page? I have seen a version here: http://jsfiddle.net/m2zQE/. To me, it would be a great addition to your plugin (I would’ve tried it myself but my programming skills are non-existent :-)).

    Best,

    Erik

    1. Did you mean highlighting the heading that the user clicked on? If so, add the following CSS to your stylesheet (change yellow to whatever colour you prefer):


      h1 span:target,
      h2 span:target,
      h3 span:target,
      h4 span:target,
      h5 span:target,
      h6 span:target {
      background: yellow;
      }

      If you’re talking about highlighting entries within a pinned TOC as the page is scrolled down, then take a look at jQuery scrollspy. If using Bootstrap as your framework, check out http://getbootstrap.com/2.3.2/javascript.html#scrollspy

      If the latter is what you meant, then no it won’t be coming in as it is heavily theme dependent and probably not as easily reusable across other themes. That said, to a theme developer, it should be fairly straightforward to add our tweaks :) As an example, we pinned a smaller version of the TOC as the page is scrolled at http://arpc.gov.au/news-and-publications/annual-reports/2011-12-annual-report/

  14. hey there, is there a way to manually choose which links go into the TOC. ive already broken down my long articles into separate articles so for these, it would be better if i could choose the links inside the TOC so i can properly order them

    1. The only way I can think of is to make the headings you want to be included the same level heading (eg heading 2) and don’t use that for any of your other headings within your content. That way you can configure the plugin to only pull out heading 2s to build the TOC.

      1. I forgot to mention. If you go down this path, you can disable the headings globally in the advanced options in Settings > TOC+. Alternatively, if you use the shortcode, there are options to specify which headings to include.

  15. Hi Mike,

    Thanks for the great plugin!

    Sorry to make this such a long post. Just trying to explain everything clearly.

    Have been using TOC+ for some time and all was well. But after adding several new plugins that include content via shortcodes:

    RPS Include Content
    EmbedIt Pro
    AcademicPress (for adding footnotes)

    TOC+ either stops working when it encounters such plugins, that use shortcodes. Or, in the case of AcademicPress, TOC+ not only stops displaying a TOC but somehow causes the footnotes created by AcademicPress to stop displaying also? This is using the latest version of all of the above mentioned plugins and WordPress 3.6.

    Please note that before posting here I took the time to read through all of your support threads over at wordpress.org as well as here on your site.

    Gathered from your comments on other posts those seem more to address TOC+ not displaying include content generated by shortcodes. However, when using TOC+ with the above mentioned plugins TOC+ stops displaying or working altogether. That would seem to indicate a more serious conflict? And, again, in the case of AcademicPress TOC+ actually stops that plugin from working too.

    Your comments on other posts indicate that a possible solution is to add code that makes sure it captures ALL of the text and content being included to generate the page, including content generated by shortcodes, and making sure the entire content of the page gets passed to TOC+. In at least one case you felt that the problem wasn’t with TOC+ but with the other plugin being coded incorrectly.

    Out of curiosity I tested the Simple TOC plugin. It does not cause AcademicPress to stop working. And, more important, it continues to work even when the RPS Include Content and/or EmbedIt Pro plugins are also in use. However, it too does not include any text or content on the page that was generated via include text plugins and shortcodes.

    Question: Do you feel it is possible to fix the above conflicts? More important, though, would you be able to create a fix so that TOC+ can include headings generated by other plugins like RPS Include Content, EmbedIt Pro, and AcademicPress?

    Last but not least, I don’t currently see where you have a donation button or whether or not that is your preference. However, if it would help facilitate bringing this functionality to TOC+ I would be willing to make a contribution to help cover the time you have to put into coding.

    Thanks again so much!

    1. Hi Phil – thanks for your extensive comment :)

      Let’s get the easy one out of the way first. Check out the appreciation section I added. Essentially, I haven’t and won’t be accepting donations but if you feel strongly in the form of helping, then please direct it towards your preferred charity.

      Next, I tried each of the plugins you listed with the goal to replicate your experience.

      Embedit Pro worked without problems for me. I enabled it, went to HTML Snippets and added a new piece of HTML content with headings (h3 and h4) then included it within my page content with [embedit snippet=”test”] and it worked ok. Even the TOC picked out the headings within the included snippet. A note with Embedit Pro though, it produces the following PHP warnings (as reported by Debug Bar):

      Notice: Use of undefined constant cf - assumed 'cf' in /data/www/two.dev/wp-content/plugins/embedit-pro/embed-it-pro.php on line 95

      Notice: Use of undefined constant snippet - assumed 'snippet' in /data/www/two.dev/wp-content/plugins/embedit-pro/embed-it-pro.php on line 103

      Notice: Use of undefined constant snippet - assumed 'snippet' in /data/www/two.dev/wp-content/plugins/embedit-pro/embed-it-pro.php on line 105

      Notice: Use of undefined constant url - assumed 'url' in /data/www/two.dev/wp-content/plugins/embedit-pro/embed-it-pro.php on line 147

      I next tried RPS Include Content and inserted [rps-include post=156] to one of my test pages with many headings. The result had included the content with post id 156 at the position I had placed the shortcode. The full TOC had all headings as expected and in the order as they appear to the public. One tip I picked up: do not use the [toc] shortcode within your content – rather, rely on the auto generation. However, if you must use the shortcode, then only use it in the parent page (the one where you you put [rps-include everywhere) otherwise the TOC may appear in a strange position.

      Both Embedit Pro and RPS Include Content worked when enabled at the same time and with content being included to the same parent.

      I couldn’t test AcademicPress because my poor mind didn’t know how to work it. However, upon enabling, the following PHP notice appears on every admin page:

      Notice: Trying to get property of non-object in /data/www/two.dev/wp-admin/includes/template.php on line 822

      And the following within the AcademicPress Virtualbox:

      Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method Acp_UI_Virtualbox::display() should not be called statically in /data/www/two.dev/wp-admin/includes/template.php on line 925

      Notice: Trying to get property of non-object in /data/www/two.dev/wp-content/plugins/academicpress/Acp/UI/Virtualbox.php on line 73

      Simple TOC (and probably other TOC plugins) would be triggering at level 10 (default) so may not be capturing any included content, or may be firing before other functionality from plugins do their bit. TOC+ fires much later at level 100 to try and ensure it captures the majority of content, including those from other plugins. If you want to experiment with TOC+ getting it to run earlier, then edit line 137 of toc.php (version 1308) and change the 100 to something like 10.

      To note, I am using the latest everything and I have auto insert for posts and pages enabled in Settings > TOC+

  16. I’m using the “Insert PHP” plugin and have a page built within there. However, the headings within my PHP code is not being detected by TOC+. Does anyone have any ideas?

    1. The plugin works on content that is presented to it via ‘the_content’. If Insert PHP isn’t using it, then this plugin won’t get access to that content.

  17. Hi Mike, let me first say that I LOVE toc+. It is not to often that I stumble upon such a great WordPress plugin. And, as a few ppl before me also have said, I would love it even more with multi-page/nextpage support. :) Any plans to support this setup any time soon? Thanks.

  18. Hello Mike!

    Is there a way to include in table of contents the headings generated in single.php?

    I have a custom single.php that displays additional content if it is a post of a certain category.

    Roman

    1. Try the help material for developers at the bottom of the help tab. I spose you could also try
      echo do_shortcode('[toc]');
      but I haven’t tried that approach yet.

      Note, you still need to make use of the_content so it can insert the anchors within the content and I believe you will need to have auto insert for posts enabled.

  19. Hello, you once helped me with my problem (as the TOC wouldn’t show no matter what and then you figured out that I have it in my sidebar… :-) ) so I was thinking of helping with translation. I’m from Czech Republic and I Love your plugin so if you want to add Czech translation, I’ll be pleased to hear what to change (if you have some special language file) and help you with that :-)

    Of course only if you’re interested :-)

    With Regards
    Jan Verner

    1. Hi Jan – hehe yes that was a ‘bright’ moment for both of us, especially after having gone through many tests :)

      It would be wonderful and of benefit to others if a Czech translation was available. The translation file can be found at http://plugins.svn.wordpress.org/table-of-contents-plus/trunk/languages/toc+.pot

      I’m not much of a translator but others have used Poedit to create their translations. If you persevere and complete a translation, please send the results to michael at this domain. Thanks for your contributions!

    1. The HTML standard only allows for ASCII characters to be used as anchors. I haven’t been able to find if the standard has been updated to allow non ASCII characters yet.

  20. Hi, I came across your toc plugin and I am impressed and can’t wait but install it immediately to my wordpress blog. The toc shows up fine right after activating the plugin, however, clicking on the link somehow does not scroll down to where it should be, it just does nothing.

    Weird thing is I tried to open my post on my iPhone iOS6, the links work!!! But on iPad, it doesn’t.

    This really annoys me, I am not sure where I have done wrong. Any advise?

    sample post: http://ordinarygeek.me/2013/09/hadoop-build-and-install-hadoop-1-2-1-eclipse-plugin/

    Thanks a lot.

    1. No shortcode property to do that but if you can add CSS, you can hide them on a per page basis by looking at the identifying class in the body tag, something like: <body class="... page-id-100 ..."

      Then use CSS like:

      .page-id-100 .toc_number {
      display: none;
      }

  21. Hello, I have a question. When I use the “exclude” option, not only does the heading disappear from the TOC, but also from the content proper of the page; what is more, the number of position in TOC remains the same, only one of them is EMPTY, like in this example:

    Before:

    1. Item no. 1
    2. Item no. 2
    3. Item no. 3

    After:

    1.
    2. Item no. 2
    3. Item no. 3

    Any way to troubleshoot it? Thanks a lot!

    1. Can you provide the full exclude property you used? Just want to see if it is simple/complex, has a wildcard, regular expression, etc.

      1. Sure, here it is: [exclude=”hubert*”]. I also used the same string in the plugin main menu options. I switched over a couple of themes but the problem appears regardless.

  22. Hello, I’m aki from Japan but living Vietnam.
    I use TOC+ in my website and I feel very nice! but I found some problems.
    Please see these pages. each page don’t have [toc] ot [notoc] but there are TOC on global option. I expect to see toc on both pages.
    http://vietnam-navi.info/vietnam/person/phan-boi-chau
    http://vietnam-navi.info/columns/infibility/viet-lao-touring-10
    I saw server log but I couldn’t find any error. The difference of these pages is it have shortcode to link other pages or not.
    Could you tell me the solution?
    Thanks,

    1. Hi Aki – I can’t see a TOC from the first link but there is a TOC on the second.

      For the first link, I had a quick look at the content for the page. Is it a special page that dynamically pulls related content from other places? Does the actual content for the page (when you hit Edit Page in the admin bar) actually have all of the content there?

      1. Hi, Mike
        Thank you for comment.
        This page has all of the content there but there is one shortcode. you can see rounded-square link in the middle of the contents, below “関連項目” heading. (I’m sorry to let you read Japanese)
        this is displayed by shortcode I made. This is used like [show id=xxxx] . xxxx will be id of the article. this cord contains function, “$post = get_post($id);”, to get other contents.

        ……Oh, I justrealize what is the problem just now during answering your question!!
        I used “wp_reset_postdata()” in the shortcode but I should use “wp_reset_query()”. I fixed just now and then I can see TOC on both page.

        If you have more suggestion, I’m happy to hear it.
        Thank you so much!!

      2. Good to know that you got it to work. No other suggestion. Provided everything is followed in the proper manner then this should “just work” :)

  23. Hello Mike,

    I love your plugin but it would be very usefull if it could take into account breaks.
    Indeed, when you have a very long post, you make often a page break.
    Your plugin have is a toc limited to 1 page and not to all pages.
    Any idea of how to us it with page breaks ?

    Thks

    Grégoire

  24. Hi, Mike! Just tried your plug-in and it’s working great. I just made a few modifications. I would like the TOC to show children (perhaps in a dropdown list, not unlike what Table of Contents Creator used to do) so that it can be a true TOC. Can you advise? All my best, Susan

  25. I am sorry for being really stupid, but this is my first time trying anything like this.

    I want a [sitemap_pages] which is working but I want to exclude some top level pages.. so i added [sitemap_pages exclude="shop"|"home"] and tried various ways of adding the exclusions.. with ” ” etc.

    what am i doing wrong?

    1. Hi Sue – the exclude property for sitemap_pages takes in the id numbers of the pages you wish to exclude (not the titles of the pages). You can find the IDs by mousing over the pages in the backend and viewing the statusbar, it should have a number in there somewhere. With the IDs, the shortcode should look something like:

      [sitemap_pages exclude="10,20,100"]

      If there is a whole section you want to exclude, you may like to try exclude_tree instead, something like:

      [sitemap_pages exclude_tree="100"]

      When in doubt, check out the help tab in Settings > TOC+ for a list of shortcodes, their properties, purpose and format.

    1. I’m not sure why it wouldn’t work as I’ve seen the plugin used on alot of Japanese websites.

      What’s the problem you’re seeing? A link would be handy if you have one.

  26. Hi Mike – I don’t know if other people have run into this problem, but I’m getting an extra and then the first letters of the headline words… Any thoughts? Help appreciated! Great tool. C

  27. Hi TOC+ Team !
    I hope you have a nice day today ^^
    I’ve just installed your great plug in but i have a little problem to exclude pages from my resume. Here my shortcode :
    [sitemap_pages no_label="false" exclude="sommaire-cours"] like you can see my ID for my page is “sommaire-cours” (not a number ??)
    And with this shortcode, my page appears in my resume, someone can help me to understand ?

    To your success,
    Ludovic

    1. Hi – the ID is meant to be the unique number for the page (rather than the title or the textual slug). You can get the ID by mousing over the page when viewing it in the list in wp-admin > pages. If you want to exclude many pages, separate them with a comma, eg: exclude=”10,11,12″

  28. Hi there,

    I’ve implemented toc plus on my wp site, and used headers to get the toc. The table is generated correctly, but when I click on any of the links, it takes me back to my homepage?! Help!

    1. Hi – I’ve had this happen before with a SEO plugin that was changing the loop and not resetting at the end. If you are running any SEO plugins, try disabling it temporarily to see if it works?

    1. You can’t without amending the right now code.

      I’ll look into enqueueing the scripts into the is_eligible function which should mean the files are loaded only when needed.

  29. Mike,

    Great plugin. I have a question:

    I want to 1 table of contents that includes posts from many pages. I want to create a table of contents within the Global Content Block plugin and just enter the shortcode of the Global Content Block plugin in any future post I want. Am I making any sense?

    Is that possible?

Leave a Reply