Inserting code into menu
-
Hi!
I’m actually editing the twenty eleven style to suit my needs, however I have a problem. I need to insert 2 divs before and after the
<ul class=”children”> …Now it looks like
<div class="menu"> <ul> <li class="page_item page-item-100 current_page_item"> <a href="https://localhost/wordpress/?page_id=69">Menu</a> <ul class="children"> <li class="page_item page-item-70"> <a href="https://localhost/wordpress/?page_id=70">Sub</a> </li> </ul> </li> </ul> </div>
And i want it to look like:
<div class="menu"> <ul> <li class="page_item page-item-100 current_page_item"> <a href="https://localhost/wordpress/?page_id=69">Menu</a> <ul class="children"> <div id="before"/> <li class="page_item page-item-70"> <a href="https://localhost/wordpress/?page_id=70">Sub 1</a> </li> <li class="page_item page-item-71"> <a href="https://localhost/wordpress/?page_id=71">Sub 2</a> </li> <div id="after"/> </ul> </li> </ul> </div>
I tried with custom walker but I believe that my knowledge in WP and PHP is quite inadequate to do that alone.
Moreover I found theoretically easier method using .before() and .after() in jQuery but I can’t use them properly.
<script>$(“???”).after(‘<div id=”after” />’);</script>
I don’t really know what should I put where ??? are.
Thank’s in advance!
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Inserting code into menu’ is closed to new replies.