• Hi. I looked at https://www.ads-software.com/extend/plugins/wp-table-of-contents/ and tried installing it, but can’t figure out how to actually use it. The documentation is unclear; it looks like I may need to make manual changes to WordPress files, or perhaps add attributes to the HTML?

    Please add a full example of how to use the plugin to the documentation. I didn’t want to give it a bad rating before I actually know how it works.

    Also, does the plugin require JavaScript to produce the table of contents?

Viewing 3 replies - 1 through 3 (of 3 total)
  • That’s exactly what I wanted to ask. I looked at the https://rastider.com/wordpress-table-of-contents-plugin#profits and added the function to the loop, but the “table of contents” didn’t appear in my posts. I checked the page source of my posts and found the jquery codes in the <head></head> but not <div class=”wp_icindekiler” id=”wp_icindekiler”> in the posts. Pls help to solve this problem.

    Plugin Author asdasafdfsdfsdfsffdsf

    (@ahmet-kaya)

    Hi guys. For the first question, yes you need to make manuel changes. I’ll update the documentation. But I must say that it’s so easy. The only thing that you need is to call the plugin function in the loop.

    Open your themes single.php file.
    Find the code: “the_content();”
    And add this code, before the_content();

    <?php if (function_exists('wp_table_of_contents')) wp_table_of_contents(); ?>

    And yes, it requires Javascript. Actually it requires jQuery. Plugin automatically call the jQuery file from Google. You can customize the settings about jQuery by editing the plugin file. If you already use a jQuery file, and if you don’t want to plugin to call jQuery file, please edit $wp_icindekiler[“jquery”] variable in wp-table-of-contents.php and put “0” instead of “1”.

    And thanks for the second question. I realized that I made a little mistake on https://rastider.com/wordpress-table-of-contents-plugin. I think you copy the code from my website, right? If so, it’s about the little coding problem below.

    The wrong code:
    <?php if (function_exists(‘wp_table_of_content’)) wp_table_of_contents(); ?>

    The correct code:
    <?php if (function_exists('wp_table_of_contents')) wp_table_of_contents(); ?>

    The problem is that I put ‘’ insteaf of ”. Sorry for this mistake. Please let me know, if it works with this code. And thanks for the feedback.

    I’m sure we’re not the only ones who are attracted to this worthwhile plug-in but give up in frustration because they can’t get it to work. Please provide exact instructions click by click and don’t assume the person knows anything other than the first hour of WordPress and CPanel. After hours, and hours, I discovered:
    I found “the_content(” only in content-single.php, not content.php
    I put <?php if (function_exists(‘wp_table_of_contents’)) wp_table_of_contents(); ?> directly in front of “the_content()” as instructed above. Didn’t work. Then I put it in front of <?php the_content(); ?>
    Didn’t work.
    What does “Add call the function in the loop: wp_table_of_contents()” mean?
    I really like your concept, you’ve done a great job. Please spend ten minutes going through the baby steps for all of us and you’ll find more people taking advantage of your well appreciated efforts.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP Table of Contents] How do I use it?’ is closed to new replies.