WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add a Javascript slide show to my WordPress home page. In my theme folder I have a js folder and then in that I have jquery.cross-slide.min.js and jquery.min.js.

This is what I have and what I'm pasting into my post area:

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cross-slide.min.js"></script>

<script type="text/javascript">
function() {
sleep: 3,
fade: 1
}, [
{ src: 'images/slideshows/block1.jpg' },
{ src: 'images/slideshows/block2.jpg' },
{ src: 'images/slideshows/block3.jpg' }

If I paste this into a WordPress page throught the HTML editor it doesn't work. Please could you check for errors and advice.

share|improve this question

You pasted this in the regular post editor, where you also type your post content? This will not work, the editor filters out invalid HTML, like Javascript. I recommend you install one of the numerous slider gallery plugins and add your images via the existing gallery functionality.

share|improve this answer
Script tags go in the document head, and should be registered/enqueued using wp_register_script() and wp_enqueue_script(), and then hooked into the document head, ideally at the wp_enqueue_scripts hook. – Chip Bennett Jun 27 '11 at 0:54

@michael - hi, you just forgot to connect this function to an element as you do in jQuery


you may read this for help

share|improve this answer

You can also try out the Cross Slide Cross Fade Plugin by christopherross.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.