Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function wp_list_pages_filter($output) {
- //$output = preg_replace('#class="noiframe">([\w\s]+)</a>[\s]*<ul class=\'children\'>#', 'class="noiframe drop">$1<ul class=\'children\'>', $output);
- $output = preg_replace("#</a>\s+<ul class='children'>#", "<!--[if gte IE 7]><!--></a><!--<![endif]-->\n<!--[if lte IE 6]><table><tr><td><![endif]-->\n<ul class='children'>", $output);
- $output = str_replace("</ul>", "</ul>\n<!--[if lte IE 6]></td></tr></table></a><![endif]-->", $output);
- return $output;
- }
- add_filter('wp_list_pages', 'wp_list_pages_filter');
- // see http://stackoverflow.com/questions/7933681/jquery-addclass-to-a-child-element
- function jquery_add_drops() {
- ?>
- <script language="JavaScript" type="text/javascript">
- jQuery(document).ready(function(){
- jQuery("li:has(ul.children) > a").addClass('drop');
- });
- </script>
- <?php
- }
- if (!(is_admin())) {
- wp_enqueue_script('jquery');
- add_action('wp_head', 'jquery_add_drops');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement