I'm helping a friend with a custom WordPress theme she purchased from Theme Forest that has a jQuery slideshow using the cycle plugin. It works just fine on all the Pages. I looked at the code and the only thing I can figure out is that on the blog pages it processes the code incorrectly by adding a backslash in front of all the " and ' characters, which breaks it in the javascript. I'm not sure where to begin to fix this. Both the page.php and the single.php file reference the following code:
<div id="slide">
<?php
if ( get_post_meta($post->ID,'head', true) ) {
echo get_post_meta($post->ID,'head', true);
} elseif ( get_post_meta($post->post_parent,'head', true) ) {
echo get_post_meta($post->post_parent,'head', true);
} else {
echo get_option('retro_headimage');
}
?>
</div>
<script type="text/javascript">
$('#slide').cycle('fade');
</script>
Which is outputted like:
<div id="slide">
<img src="/wp-content/uploads/2009/11/over-the-hill.jpg" alt="" />
</div>
<script type="text/javascript">
$('#slide').cycle('fade');
</script>
On the post pages that don't have the post_meta of 'head' set, this is the outputted html:
<div id="slide">
<img src=\"/wp-content/uploads/2009/11/over-the-hill.jpg\" alt=\"\" />
</div>
<script type="text/javascript">
$('#slide').cycle('fade');
</script>
Which breaks the javascript. So I noticed that it was echoing an option of 'retro_headimage' which is set in the Theme Options page in the dashboard. The problem is, anytime you go into that Theme Options page and re-enter the correct code for the image upon saving it the backslashes reappear. Can anybody help?