I’m using the following inside images-options which is linked to functions.php
. When clicked on submit button it crashes in WordPress admin.
<th scope="row">Image 1:</th>
<td>
<input type="text" name="director_image1" value="<?php print get_option('director_image1'); ?>" />
<br/>
</td>
</tr>
I am using this to get the image in header.php
.
var theImage=<?php $image = get_option('director_image1');?>
<?php if( $image) : ?>
<?php echo "'".$image."';"; ?>
<?php endif; ?>
And finally i am using theImage variable inside a javascript file :
{
src: theImage
fade: 3000
}
Could you please help me out the image is not being displayed.
The problem was that i didn’t add
,
after the link which is necessary in javascript. But i used;
which is shouldn’t be added after a link src in javascript.