WordPress.org

Ready to get started?Download WordPress

Forums

Table of Contents Plus
TOC appearing twice on page (8 posts)

  1. feshin
    Member
    Posted 1 year ago #

    Hi conjur3r--

    Loving this plugin. I'm having just a bit of odd behavior with it.

    • I've got a page set as the home of the site.
    • That page also pulls in a custom content type in the right column.
    • The main content of the page and the right column are both displaying a table of contents.
    • The toc's do list different things - respective of their content type.
    • If I "hide" one it hides both toc's at the same time.
    • I only have the "page" content type checked

    Any help would be super appreciated. Let me know if you need more info.

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

  2. feshin
    Member
    Posted 1 year ago #

    A follow-up:

    I've tried putting in the short code [no_toc], but it doesn't have any affect on the custom content type in the right column.

  3. Mike
    Member
    Plugin Author

    Posted 1 year ago #

    That will be hard one and I don't have any ideas right now so I'll need to replicate the issue. How were the custom post types done? Did you use a plugin or theme that I can download and try out?

    Btw, sorry for lateness, the RSS feeds for the WP forums are sloooow at updating.

  4. feshin
    Member
    Posted 1 year ago #

    Hey Michael T--

    The custom content plugin I'm using is Custom Post Widget. This plugin creates a new content type called "Content Block". I've created a content block titled "Right Column" and then placed a widget with that block in the right column.

    The additional toc shows up only if there are enough subheadings in the content block. In my case I set it to only show if there are four or more headings. Strangely enough it seems that any heading level is counted in the case of this content type even if toc+ is set to exclude them. For example, I'm only counting h2's, but if I use h5's in the content block it still shows the additional toc in the right column.

    The theme is a custom theme (internal company intranet).

    Would it be better to post these messages somewhere else? If so, just let me know.

    I really appreciate your help.

  5. Mike
    Member
    Plugin Author

    Posted 1 year ago #

    I've had a chance to investigate and ran through roughly the same configuration as you. I'm using the Twenty Eleven theme, installed Custom Post Widget, created a content block and pasted content with many headings. I then dragged the content block widget into one of my sidebars and it appears where it should be. I then changed my homepage to a static page and can see the TOC get printed out on both the main content and the widget area. I wasn't expecting it be printed in the widget at all as it is a different content type and custom content types are disabled from auto insertion by default.

    After further investigation, it turns out the main content of the page dictates the content type for all, eg because the homepage's main content is from a static page, it treats everything else on the page as content type 'page' and loses the content block type. This means the widget will auto insert a TOC if you have page selected in your TOC+ settings.

    After discovering this, I began testing your other issues but wasn't able to replicate them.

    1. I added [no_toc] to the top of the content block and it suppressed the TOC for itself only. The TOC for the main content on the homepage still appeared.

    2. I unchecked headings in the advanced options and they were appropriately excluded.

    I'm not sure where to go from here. The only thing I can think of is maybe order will matter so check to see if you're calling the_content on the main content prior to the widget stuff?

    Another suggestion would be to try and use a text widget for your right hand side content?

  6. feshin
    Member
    Posted 1 year ago #

    Hey Michael T--

    Did you try adding at least four or more headings (in my case I'm using 4 or more h2s) to the custom post widget? Your steps work exactly the same for me until I get to that point:

    1. Create the content block with only one heading
    2. Put the widget in the right column
    3. Reload the page - two toc's should show up
    4. Add [no_toc] to top of content block
    5. Reload the page - toc is correctly hidden
    6. Add three or more headings to content block
    7. Reload the page - toc is now showing again even though [no_toc] is set.

    I looked in the templates and I'm calling get_sidebar after the content.

    Again, I really appreciate your help with this. Do you have anywhere to make donations?

  7. feshin
    Member
    Posted 1 year ago #

    I just tried it with the twentyeleven theme, too. In order to get the sidebar showing on a static page I added get_sidebar to the bottom of the page.php template (just for testing).

    I get the same behavior when I add that in.

  8. Mike
    Member
    Plugin Author

    Posted 1 year ago #

    Yes the widget content had 6 headings. I just created a new conten block with only one heading and used that as the source for the widget but no TOC appeared in the widget. The TOC for the main content still does though.

    With Twenty Eleven, I didn't have to edit any templates to get the sidebar. I added the widget into the Footer Area Two sidebar which means you get a the cotent at the bottom (rather than the RHS) but it should be the same test case. Does this work for you?

    I'm not accepting donations - if you like it, spreading the word is good enough for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.