Closed tgelles closed 10 years ago
The page title definitely shouldn't be affecting the TOC. Do you have a public URL I could look at?
Sure!
Here's a page that I added a second, hidden h1 tag: http://devng.sdss.org/test/
And here's a page that does not have a second h1 tag: http://devng.sdss.org/test2/
The reason this isn't working is because none of your other headers are sibling DOM elements to your initial h1
(you have wrapped it in a separate page header div
).
This is related to the content algorithm that Tocify uses to generate the TOC (referenced in #46 ). If you change the <h1>test</h1>
from being a header, it should work as you expect.
I'm using tocify with Wordpress, and noticed that the page title that Wordpress renders is causing a bug with the TOC.
In order for the other headings to get rendered and displayed properly, I need to add another H1 to the top of the page...which isn't really ideal. If I don't add a second h1 tag, only the page title will display in the table of contents.
Has anyone else encountered this and/or have a workaround?
For what it's worth I'm using the Roots theme.