Support » Fixing WordPress » Jquery inside a post

  • Hi all,

    I’m trying to get a simple jquery image swap working in one of my posts. Basically when you click on a different color, the picture is shown in that color. I got the plug in working offline on my desktop, but implementing it into WordPress seems to be breaking it. I’ve checked if WordPress is detecting the jquery library, and it is. Below is the code inside my post for reference..

    <script type="text/javascipt">
       $("img.img-swap").attr("src", "");
       $("img.img-swap").attr("src", "");
       $("img.img-swap").attr("src", "");
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("bongos") ) : ?>
    <?php endif; ?>
    <div class="left">
    <p>Double Conga Set 10” & 11” with Stand </p>
    <li><a class="swap1" href="#">-BK (Black Wood)</a></li>
    <li><a class="swap2" href="#">-NA (Natural)</a></li>
    <li><a class="swap3" href="#">-RW (Red Wood)</a></li>
    <div class="right">
    <img class="img-swap" src="" alt="Mano Conga" />

    I have the phpexec plug in running, the widgets are working perfectly. It’s only the Jquery that doesn’t seem to be working.

    Thanks for you help!

Viewing 1 replies (of 1 total)
  • Do you have a link I could check out? My first thought is if you are using the version of jQuery that WordPress loads, I believe it loads it in compatibility mode, which means to reference it you can’t use $, you have to use jQuery. So you could try replacing the $ with jQuery and see if that works.

Viewing 1 replies (of 1 total)
  • The topic ‘Jquery inside a post’ is closed to new replies.