WordPress.org

Ready to get started?Download WordPress

Forums

Table of Contents Plus
How to add the table of content in page templat (4 posts)

  1. ldetomasi
    Member
    Posted 2 years ago #

    I would like to add the table of content in a custom page template, in the sidebar. Is there a function to display it in a specific div?
    Thank you

    http://wordpress.org/extend/plugins/table-of-contents-plus/

  2. Mike
    Member
    Plugin Author

    Posted 2 years ago #

    Right now there isn't an easy one function call to do what you want. If you search for function widget, the closest you'll get is:


    $items = $tic->extract_headings( &$find, &$replace, $post->post_content );

    The first and second parameters are empty arrays, but you must supply the content for the third. $items is a HTML formatted string of list items so you'll need to wrap starting and closing ul or ol and your divs.

  3. ldetomasi
    Member
    Posted 2 years ago #

    Thank you very much, Michael.
    If you are going to implement this new function, I'll wait.
    Otherwise I'll start working on it.+
    Let me know.

  4. Mike
    Member
    Plugin Author

    Posted 2 years ago #

    You can try that line I sent earlier. To access $tic, you might need to add global $tic; before you use it. If you get it working, it'll continue to work when/if a new simpler method comes around later. It'll be in the changelog when it happens.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic