• When working with menus in adding posts or pages, WordPress will naturally add a class to the parent element of the link (the li element). Can I use this approach with this plugin? If so, what do I need to adjust in the settings of this plugin?

    For example, if I have the following menu item in code…

    <li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-37" class="post-19 menu-item menu-item-type-post_type menu-item-object-post menu-item-37 nav-item"><a title="About Us" href="//localhost:3000/my-site/about/" class="nav-link" data-ps2id-api="true">About Us</a></li>

    …as you can see, I placed post-19 on the li element. Once this anchor link is clicked, I would like it to scroll to ID post-19 on the same page.

    Is this possible without changing the HTML markup?

    • This topic was modified 5 years, 4 months ago by klewis.
    • This topic was modified 5 years, 4 months ago by klewis.
    • This topic was modified 5 years, 4 months ago by klewis.
    • This topic was modified 5 years, 4 months ago by klewis.
    • This topic was modified 5 years, 4 months ago by klewis.
    • This topic was modified 5 years, 4 months ago by klewis.
    • This topic was modified 5 years, 4 months ago by klewis.
Viewing 1 replies (of 1 total)
  • Plugin Author malihu

    (@malihu)

    You should set the link’s URL to point to your post id, like this:

    //localhost:3000/my-site/about/#post-19

    Is there a reason you cannot do this?

Viewing 1 replies (of 1 total)
  • The topic ‘Can I set the class to the link’s parent element?’ is closed to new replies.