Title: Plugin not adding -first / -last to highlight classes
Last modified: June 17, 2020

---

# Plugin not adding -first / -last to highlight classes

 *  Resolved [JenWebDev](https://wordpress.org/support/users/jenwebdev/)
 * (@jenwebdev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-not-adding-first-last-to-highlight-classes/)
 * Site under construction. When my page loads, I’m gettting the first two menu 
   items highlighted I need to remove the second highlight. The documentation says
   the plugin adds -first and -last when multiple items are highlighted, but it’s
   not doing that.
 * I have “only highlight one item at a time” checked, but it’s not working in this
   case. “Prevent other scripts from handling plugin’s links” is also checked. The
   first two items remain highlighted unless I shorten the browser window so the
   second section is well out of view.
 * This is a twentytwenty-child theme.
 * Is there a way to override this or designate the second highlighted item? I’ve
   tried adding
    `<script>document.getElementsByClassName('mPS2id-highlight')[1].
   style.color = '#482E42';</script>` to the header, which worked in another site,
   but it’s not working on this one.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplugin-not-adding-first-last-to-highlight-classes%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-not-adding-first-last-to-highlight-classes/#post-13003597)
 * Hi,
 * Disable “Allow only one highlighted element at a time” option. When it’s enabled,“-
   first” and “-last” classes do not apply, so disable the option.
 * Also, it’s better in your case to add a highlight selector, so add the following
   value in “Highlight selector(s)” option:
 * `.primary-menu a`
 * Doing this you’ll be able to use `mPS2id-highlight-first` class in your CSS.
 * You could also use your existing target ids (“#about-section”, “#home-section”
   etc.) instead of the ones you added (“#about”, “#home” etc.) but you’d need to
   disable “Highlight by next target” option for that.
 * Let me know
 *  Thread Starter [JenWebDev](https://wordpress.org/support/users/jenwebdev/)
 * (@jenwebdev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-not-adding-first-last-to-highlight-classes/#post-13016451)
 * The last suggestion got it, thank you.
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-not-adding-first-last-to-highlight-classes/#post-13016629)
 * You’re welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin not adding -first / -last to highlight classes’ is closed to new
replies.

 * ![](https://ps.w.org/page-scroll-to-id/assets/icon-256x256.png?rev=1401043)
 * [Page scroll to id](https://wordpress.org/plugins/page-scroll-to-id/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-scroll-to-id/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-scroll-to-id/)
 * [Active Topics](https://wordpress.org/support/plugin/page-scroll-to-id/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-scroll-to-id/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-scroll-to-id/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [malihu](https://wordpress.org/support/users/malihu/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-not-adding-first-last-to-highlight-classes/#post-13016629)
 * Status: resolved