Title: Jquery inside a post
Last modified: August 20, 2016

---

# Jquery inside a post

 *  [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * (@bluedrag)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/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">
       $(document).ready(function(){
   
        $("a.swap1").click(function(){
          $("img.img-swap").attr("src", "http://konggraphics.com/mano/wp-content/uploads/2012/01/MP1601BK.png");
        });
   
        $("a.swap2").click(function(){
          $("img.img-swap").attr("src", "http://konggraphics.com/mano/wp-content/uploads/2012/01/MP1601NA.png");
        });
   
        $("a.swap3").click(function(){
          $("img.img-swap").attr("src", "http://konggraphics.com/mano/wp-content/uploads/2012/01/MP1601RW.png");
        });
   
       });
   
       </script>
   
       <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("bongos") ) : ?>
       <?php endif; ?>
   
       <div class="left">
   
       <h1>C1601</h1>
   
       <p>Double Conga Set 10” & 11” with Stand </p>
   
       <ul>
       <li><strong>Colours:</strong></li>
       <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>
       </ul>
   
       </div>
   
       <div class="right">
       <img class="img-swap" src="http://konggraphics.com/mano/wp-content/uploads/2012/01/MP1601BK.png" alt="Mano Conga" />
   
       </div>
       ```
   
 * 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)

 *  [Darin Kotter](https://wordpress.org/support/users/dkotter/)
 * (@dkotter)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/jquery-inside-a-post/#post-2502824)
 * 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](http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/),
   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.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [image swap](https://wordpress.org/support/topic-tag/image-swap/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [programming](https://wordpress.org/support/topic-tag/programming/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Darin Kotter](https://wordpress.org/support/users/dkotter/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/jquery-inside-a-post/#post-2502824)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
