infinum/eightshift-frontend-libs

Table of Contents not working due to a Class name change.

Closed this issue · 1 comments

Line number 16 of the index.js file broke when WordPress updated the class name from .main-content to .entry.content. Updating this one line of javascript seems to fix the issue.

const headings = document.querySelectorAll(`.main-content :is(${levelsToUse})`);

Hi, thanks for the input!

However, in the default Eightshift setup the body class is set to main-content and is not affected by WordPress updates.

Feel free to customize it in your theme if your setup is slightly different 🙂