Support » Plugin: JQuery Accordion Menu Widget » [Plugin: JQuery Accordion Menu Widget] open the parent div if the page/post is active

  • I am working on a portfolio where i have many posts under different categories. I have top navigation as custom menu and have given url to specific post. For example in the site:
    ARTWORK has custom url to the post
    –forever is a long time

    I want to be able to make sure that the 2008 is open when the I click on artwork. Also I hope the same rule applies when i click on next and previous button on the right(which is post navigation), I would like to see the accordion open and close when the respective page is on view.

    So far what I have is:
    in function.php

    if ( ! function_exists( 'post_is_in_descendant_category' ) ) {
          function post_is_in_descendant_category( $cats, $_post = null ) {
              foreach ( (array) $cats as $cat ) {
                  // get_term_children() accepts integer ID only
                  $descendants = get_term_children( (int) $cat, 'category' );
                  if ( $descendants && in_category( $descendants, $_post ) )
                      return true;
              return false;

    and then I am thinking f doing something like following but of course its not working.

    if (in_the_category|| post_is_in_descendant_category()){
    $('li.'+defaults.classExpand+' > a').addClass(defaults.classActive);

    Please someone kindly help.
    Thank you.

Viewing 1 replies (of 1 total)
  • I’m after the same thing.

    I need some subsections to be open by default on certain pages/posts only. I would greatly appreciate if someone could help on “how to”


Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: JQuery Accordion Menu Widget] open the parent div if the page/post is active’ is closed to new replies.