WordPress.org

Ready to get started?Download WordPress

Forums

Adding a class to sub-menu (4 posts)

  1. koolika
    Member
    Posted 1 year ago #

    THis solution with JQuery will add class to your sub menu so you can achieve drop down using CSS.

    Add a title in WP to each <li> under the same sub-menu

    JQuery:
    Search for the title and add a class.
    $(document).ready(function() {
    $('a[title="Audio songs sub"]').closest('.sub-menu').addClass('parent1');
    });
  2. kjodle
    Member
    Posted 1 year ago #

    Please put your code samples between backticks. Your code is breaking this page.

    Could a moderator fix this so we can make sure we are seeing all of his code? Thanks!

  3. Fixed but I don't know if the forum didn't eat some :/

  4. kjodle
    Member
    Posted 1 year ago #

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic