Can you provide a link to your site please, and maybe show the code that you’re using to implement your script?
Thanks.
Thread Starter
cielle
(@cielle)
yes! thank you! my site is http://www.yeswearestars.gr
the code ( i don’t have this on my site currently as it “broke” the page… )is this:
function my_div_shuffler() {
if (is_page(60)){
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
(function($){
$.fn.shuffle = function() {
var allElems = this.get(),
getRandom = function(max) {
return Math.floor(Math.random() * max);
},
shuffled = $.map(allElems, function(){
var random = getRandom(allElems.length),
randEl = $(allElems[random]).clone(true)[0];
allElems.splice(random, 1);
return randEl;
});
this.each(function(i){
$(this).replaceWith($(shuffled[i]));
});
return $(shuffled);
};
})(jQuery);
</script>
<script type="text/javascript">
$(document).ready(function() {
$('div.deeppink,div.white,div.hotpink,div.pink,div.orchid,div.plum,div.turquoise,div.violet').shuffle();
});
</script>
<?php
}
}
add_action('wp_head', 'my_div_shuffler');
Thread Starter
cielle
(@cielle)
ok ok !! I am so sorry, this appears to now be working!!! I don’t even know what i did, it must have been something that i had not put in the correct place or something in my custom.php…
so sorry, thank you so much for your time and help!
Obviously, just my focus here with your help solved this!