WordPress outputs my child menus inside this ul tag…
<ul class="sub-menu">
how can I wrap a simple div around it?
Preferably a way to do it through functions.php, but jquery can work too.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While it would be EASY to use something like jQuery to wrap your child menus, it is NOT good practice to use jQuery for this purpose. Place this in functions.php:
I’m assuming that your menu is being generated in your header, so go to header.php (or whatever file is utilizing the wp_nav_menu function) and look for anything that starts with “wp_nav_menu”.
Since I don’t have any code to see, I can only guess the arguments that it’s using (if any). If it looks EXACTLY like “wp_nav_menu()” with nothing in between the parenthesis, then change it to the following:
Otherwise, please edit your question with the code that your menu is using so I can help you further.