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

  • Home
  • SEARCH
  • 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 7861363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:42:01+00:00 2026-06-02T22:42:01+00:00

I created a accordion shortcode for wordpress and works fine until there is only

  • 0

I created a accordion shortcode for wordpress and works fine until there is only one accordion one the page…

Here is the problem http://panel.daweb.cz/?page_id=119

Accordions are at bottom of page one works fine but second one does not. I am using jQuery jquery-ui.js for accordion effect (http://jqueryui.com/demos/accordion/).

Does someone know how to fix it or where is really good tutorial how to do accordion shortcode for wp?

Thanks for your time

  • 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-06-02T22:42:03+00:00Added an answer on June 2, 2026 at 10:42 pm

    In your JavaScript file otherjs.js you have this code at the bottom

    // Load accordion   
    $(function() {
        $( "#accordion" ).accordion();
        $('.flexslider').flexslider();  
    });
    

    Both your accordians have the ID of ‘accordion’. Two items on the same page should not have the same ID as they must be unique and this means jQuery will only be setting the first accordion it finds up.

    What you need to do is give your first accordion the ID of accordion1 and the second accordion2 then change your JavaScript in otherjs.js to this:

    // Load accordion   
    $(function() {
        $( "#accordion1" ).accordion();
        $( "#accordion2" ).accordion();
        $('.flexslider').flexslider();  
    });
    

    Alternatively you could get rid of the ID for both your accordions and give them the class accordion then you’d use this code to load the accordions:

    // Load accordion   
    $(function() {
        $( ".accordion" ).accordion();
        $('.flexslider').flexslider();  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a jQuery accordion for my website, it all works very fine. But
I want create an accordion control similar to one created using AJAX http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Accordion/Accordion.aspx where
This is a funny one... I have created a mootools accordion with tabs, each
I'm using primefaces' accordion panel. Inside the tabs i have forms which are created
I have created an accordion using jQuery which collapses fine when the user clicks
I have created an accordion menu. Here is my js code: var menu =
I am trying to create a Outlook style accordion for my page. The problem
how to hide the panel inside the accordion created using JQuery? js files: <script
I have created an accordion in such a way that only 1 set of
I've created accordion like this: layout:'accordion', layoutConfig:{ animate:true } then i add elements by

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.