Got an issue with an accordion script, the accordion labored after i was dealing with it with straight html, however getting gone to live in wordpress the accordion has eliminate.

Here's my code

  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
  <script>
  $(document).ready(function() {
    $("#accordion").accordion();
  });
  </script>
<?php wp_head(); ?>

and also the html:

            <div id="accordion">
 <div class="button"><a href="#">Infrastructure</a></div>
    <div><?php
            if (function_exists('iinclude_page')){
                iinclude_page('sectors/infrastructure');
            }?>
            </div>
    <div class="button"><a href="#">Housing</a></div>
    <div><?php
            if (function_exists('iinclude_page')){
                iinclude_page('sectors/housing');
            }?></div>
                <div class="button"><a href="#">Education</a></div>
    <div><?php
            if (function_exists('iinclude_page')){
                iinclude_page('sectors/education');
            }?></div>
                <div class="button"><a href="#">Health</a></div>
    <div><?php
            if (function_exists('iinclude_page')){
                iinclude_page('sectors/health');
            }?></div>
</div>

I truly do not comprehend the problem, because it labored in straight html. I've even attempted getting rid of the include function with straight text also it still does not work?

Any ideas? You will find not one other jquery objects interfearing either.

You are loading jQuery two times (1.5 then 1.7.1), and loading jQuery UI after loading 1.5 before loading 1.7.1. So this is what happens:

  1. jQuery 1.5 is loaded.

  2. jQuery UI is loaded and attaches itself towards the jQuery object that is available at that time.

  3. jQuery 1.7.1 is loaded, completely changing the jQuery object.

  4. Your code runs, while using (1.7.1) jQuery object, which jQuery UI has not added its goodness to.

Should you load jQuery only once, and make certain you load jQuery UI after, it'll work.

You are including jQuery two times, possibly that's this problem?

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
..
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

Are you able to show me the entire html advertising media are it using blogging platforms. I believed that maybe within the include pages you will find some unclosed tags that may corrupt the accordion.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

And then try to don't place jQuery two times.