Jump to content

Archived

This topic is now archived and is closed to further replies.

chamois_blanc

Accordions are broken

Recommended Posts

chamois_blanc

Hello,

All accordion entries are shown every time, independently of the set selected. See example here:

         http://swinginatthesavoy.com/register/

The first accordion should only show the 2nd and 3rd entries, instead of all of them. The second accordion should only show the 1st entry.

Please fix asap! I haven't changed anything to my content in a few weeks and it was working fine before. I am guessing this appeared in one of the latest DMS updates. I am going to use some CSS to try to hide the undesirable entries.

Gilles

Share this post


Link to post
Share on other sites
Simon

All looks fine to me?

Share this post


Link to post
Share on other sites
chamois_blanc

I've just added this to make the undesired section disappear. Feel free to manually remove the 'display: none' in your browser and see what happens.

section#accordionsue6k9dr div#accordions-ue6k9drhousing {

  .ac395-accordions-ue6k9dr, div#ac395-accordions-ue6k9dr,

  .ac256-accordions-ue6k9dr, div#ac256-accordions-ue6k9dr {

    display: none !important;

  }

}

section#accordionsu4co0cg div#accordions-u4co0cgvolunteering {

  .ac340-accordions-u4co0cg, div#ac340-accordions-u4co0cg,

  .ac339-accordions-u4co0cg, div#ac339-accordions-u4co0cg,

  .ac256-accordions-u4co0cg, div#ac256-accordions-u4co0cg {

    display: none !important;

  }

}

Share this post


Link to post
Share on other sites
Simon

before you added that code, i saw 4 bars, and all 4 worked perfectly.

 

Maybe a screencast of the issue might help?

The accordians code has never been changed, no update will have changed anything. Might be a css/js conflict with another plugin

Share this post


Link to post
Share on other sites
chamois_blanc

The problem is that it should not show the 4 entries. It should only show two.

Hmm I'm seeing different behavior in Chrome versus Safari. Something more is going on. Will keep you posted.

Share this post


Link to post
Share on other sites
chamois_blanc

Okay not browser related after all.

The query below is returning all accordions sets every time, instead of the one specified by $this->opt('accordion_set'). Not sure why the query is not working anymore. This code below is from section.php in the accordions plugin directory.

                // Actions      

                        // Set up the query for this page

                                $orderby = (  $this->opt('accordion_orderby') ) ?  $this->opt('accordion_orderby') : 'ID';

                                $order = (  $this->opt('accordion_order') ) ?  $this->opt('accordion_order') : 'DESC';

                                $params = array( 'orderby'      => $orderby, 'order' => $order, 'post_type'     => $this->ptID, 'posts_per_page' => -1 );

                                $params[ $this->taxID ] = (  $this->opt( 'accordion_set' ) ) ?  $this->opt( 'accordion_set' ) : null;

                                $q = new WP_Query( $params );

Share this post


Link to post
Share on other sites
chamois_blanc

Isn't this syntax deprecated though? shouldn't tax_query be used instead?

Share this post


Link to post
Share on other sites
chamois_blanc

Indeed, this code seems to fix the problem:

                                $accordion_set = (  $this->opt( 'accordion_set' ) ) ?  $this->opt( 'accordion_set' ) : null;

                                $params['tax_query'] = array(array( 'taxonomy' => $this->taxID, 'field' => 'slug', 'terms' => array($accordion_set) ));

                                //$params[ $this->taxID ] = (  $this->opt( 'accordion_set' ) ) ?  $this->opt( 'accordion_set' ) : null;

                                $q = new WP_Query( $params );

Share this post


Link to post
Share on other sites
Simon

I updated the zip with your change.

Share this post


Link to post
Share on other sites
Gavin_

Thanks - where do you add that code? 
Which line? 

Cheers

Share this post


Link to post
Share on other sites
Simon

just search for '$params[ $this->taxID ]'

Share this post


Link to post
Share on other sites
chamois_blanc

To be a little more precise, the change is in this file:

      wp-content/plugins/accordions/sections/accordions/section.php

wherever that's located in your installation (maybe under the wordpress directory), on line 626.

 

Share this post


Link to post
Share on other sites
meetgreen

Where do we get the updated zip with the correction? Cannot find it. Please link. 

Share this post


Link to post
Share on other sites
chamois_blanc

Here is my updated zip file

/please private message to send files as this is a public forum/

Share this post


Link to post
Share on other sites

  • Similar Content

    • petere21
      By petere21+
      As I understand El Sues Accordions section is broken. Simon solved this problem by fixing section and we need to download it again.
      But in my account in download area there is no accordions section to download. Where can I download it? !!! Asap please my web is broken.
      Peter
       
    • balfred1345
      By balfred1345
      Hi Ellen,
      I've tried every way I could think of to use CSS to get rid of what I assume is padding or margin from the top of the accordion section so that it can be closer to the <p> above it. 
      Here's a screenshot of the way it looks now:  http://screencast.com/t/2c66f6y0dex
      If you'd like to look at the page please see: http://whub34.webhostinghub.com/~videoh6/cidev2.com/moving-services/mankato-mn-movers/
      I'd like to have the accordion section with the word "More" much closer to the paragraph line above it. If you look at the CSS you'll see several instances where I put in margin: 0 !important; and padding: 0 !important.
      Can you please tell me how I can adjust the section so it is closer to the paragraph above it?
      This site is on latest versions of DMS 2 and WP. 
      Many thanks,
      Bruce
    • flourishdesignstudio
      By flourishdesignstudio+
      Hello,
      I wanted to let the community know that there is a problem that has happened on a couple of DMS sites that we manage. The problem is that there are certain plugins/sections that DMS uses (such as 'Accordions' and 'Sidekick') that will appear to have an update. However, when you actually update the plugin it is replaced but a similarly named plugin. Here are the original plugins:
       
      Original: http://dms.elsue.com/accordions/ (authored by @ellenmva)
      Replaced with: https://wordpress.org/plugins/accordions/
       
      Original: http://www.pagelines.com/shop/third-party-extensions/sidekick/ (authored by Evan Mattson)
      Replaced with: https://wordpress.org/plugins/sidekick/
       
      I just wanted to know if there is anything I can do to make sure that other plugins/sections do not get replaced when I update them in the future as well as bring it to the DMS community's attention so that others do not experience the same confusion and frustration. Any thoughts would be very welcome in order to avoid this in the future.
      Thanks!
    • alisamski
      By alisamski+
      Using the accordion section... and I am trying to link a menu item to the accordion title.. not individual areas...
      My links work in the main menu, linking to an accordion title... however, they seem to have issues... I have two accordions on this page...
      When I use the menu link (below).. it breaks the accordion action... it will not open the accordion to show all the content.
      http://bit.ly/1TepJ3s
      http://bit.ly/1Hwqf84
      however when I go to the actual page.. there is no issue.
      http://bit.ly/1QPBt8r
      Please if you can take a look, I'd appreciate it.. not sure if I have the link correct.
    • camaran
      By camaran
      If i enable Accordions plugin in my wordpress 4.2.1 i cannot edit menu becuase i lost all items, if i disable accordions work, can you check pleas?
×