Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7647743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:32:20+00:00 2026-05-31T10:32:20+00:00

I worked on wordpress and I found it via google. Then the only thing

  • 0

I worked on wordpress and I found it via google. Then the only thing puzzling me is how to make the parent link to be allowed to expand the submenu instead of having the parent links be clickable..

jQuery(document).ready(function() {

//Hide the submenus
jQuery('.leftNav_Level2 ul li ul').hide();

//If its a page parent (based off wordpress), add the class "displayMe"
//This way the accordion will be opened up on the page you are on.
if (jQuery('.leftNav_Level2 ul li').hasClass("current_page_parent")) {
jQuery('.leftNav_Level2 .current_page_parent ul').addClass("displayMe");
jQuery('.leftNav_Level2 .current_page_ancestor > ul').attr('style','display:block');
jQuery('.leftNav_Level2 .current_page_parent > ul').attr('style','display:block');
}
jQuery('.leftNav_Level2 .current_page_item > ul').attr('style','display:block');


//When you click it, toggle
jQuery('.leftNav_Level2 ul li a').click(
function() {

//Onclick Remove the class dipslay me which is only display:block;
//This way they can close it if they click it or it will glitch
jQuery(this).next().next().slideToggle('slow').removeClass("displayMe");

//return false so the # doenst move view to the top of the page
if (jQuery(this).attr('href') == '#') { return false; }

//Close it all out
});
}); 

the wordpress template has:

  <div class="leftNav_Level2">
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
</div><!--/leftNav_Level1-->

will appreciate help thank u

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:32:22+00:00Added an answer on May 31, 2026 at 10:32 am

    You are using too much javascript to solve the problem. I would say, use CSS for the styling (open/close submenus etc), a tutorial for that is here: http://wpguru.co.za/navigation/make-your-own-wordpress-drop-down-menu/

    If you want the parent nodes stop navigating to the linked pages, you can use:

    jQuery('.leftNav_Level2 ul>li.current_page_ancestor').click(function(e) {
        e.preventDefault();
    });
    

    You can also take a look at the new menu since WP 3.0, more info here: http://bavotasan.com/2010/wordpress-3-checking-out-the-new-menu-system/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I changed the folder that my WordPress installation was in. However, this worked fine,
I moved an ex-site based on joomla to wordpress. Import worked fine but the
I do a lot of tutorials using Wordpress. The main characteristic thing is that
Has anyone ever worked on a WordPress project with multiple developers in different locations?
Edit 3/02/12: Found another solution that worked by itself without the need for any
I am creating a plugin for Wordpress and haven't really worked with Wordpress very
Yesterday, i Worked on a Wordpress theme in the Editor, to lazy to do
In wordpress <?php bloginfo('url'); ?> is the main page's url, then, how to write
Here's the Google Plus One script I've been using on my WordPress blog: <g:plusone
Having worked with Classic ASP for about 2 years now by creating a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.