• Resolved ianrobertdouglas

    (@ianrobertdouglas)


    Hi,
    I’m using the shortcode [lwptoc] to include the TOC in a custom sidebar. My problem is that my theme uses inline Related Posts. And the TOC is picking these up, because they’re set in the <h3> tag. I cannot exclude the <h3> tag easily; I use it for headings throughout my site.
    I was wondering if it’s possible, instead of the shortcode, to use a PHP snippet instead that includes a line for custom exclusions.
    That way I could edit to include exclusions on a post-by-post basis.
    Or maybe you have a better idea.
    Alternatively, if a <div> class, or even a <h3> class, could be excluded, that would work globally.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author LuckyWP

    (@theluckywp)

    Hello!

    Unfortunately, while the plugin can not filter headings by class or ID.

    Can you explain the option with PHP snippet and post-by-post exclusions?

    Thread Starter ianrobertdouglas

    (@ianrobertdouglas)

    Thank you for your reply.
    I moved over to the Easy Table of Contents plugin, which includes a few more options for text value exclusions

    Plugin Author LuckyWP

    (@theluckywp)

    @ianrobertdouglas what are the options?

    We will try to implement this in future versions ??

    Thread Starter ianrobertdouglas

    (@ianrobertdouglas)

    I’m not sure if you have anything like this, but Easy Table of Contents includes the following section, which works okay on a post-by-post basis.

    https://d.pr/i/9whTVw

    It’s still not exactly ideal, however. The posts in my inline Related Posts section might change dynamically, so would be pulled into the TOC. What would be better would be if you could exclude a headings tag attached to a particular selector (e.g., h3.jeg_post_title)

    Plugin Author LuckyWP

    (@theluckywp)

    LuckyWP Table of Contents has option “Skip by text”: https://ps.w.org/luckywp-table-of-contents/assets/screenshot-11.png?rev=2133515

    But exclude by class – this is best solution in your case. In one of future version we make this.

    Thread Starter ianrobertdouglas

    (@ianrobertdouglas)

    The difference with the Easy Table of Contents plugin is that those exclusions are on a post-by-post basis. In LuckyWP TOC plugin, they’re global.

    The problem with exclusions in my case is that the inline content will change if I add new posts to that category, so there is the risk of those new post titles being added to my TOC for all posts in that category.

    Better would be a custom exclude by class.

    Plugin Author LuckyWP

    (@theluckywp)

    LuckyWP ToC added metabox to each post. Where you can customize options only this post.

    Are there any ETA on the option to exclude by Class?

    Plugin Author LuckyWP

    (@theluckywp)

    @mpstranger Unfortunately, now we can’t set ETA ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Manual exclusion per post’ is closed to new replies.