I am beginner in PHP, so maybe for some of you this question is ridiculous.
I would like to get image title and caption from jquery slider. (Themeforest Delight theme – http://www.pixedelic.com/themes/delight/), to show them in the same way as in (http://themes.themegoods.com/dk_wp/).
I have tried almost everything.
Thanks in advance for your help.
Here is the code from header:
<?php
function default_bg(){
if(get_pix_option('pix_general_background')=='slideshow'){ ?>
<div class="pix_slide" data-position="fixed" data-top="0" data-bottom="not">
<?php
$slide_general = get_pix_option('pix_array_slide_general_');
foreach ($slide_general as $slide) {
echo '<div data-src="'. $slide .'" data-thumb="'. get_pix_thumb($slide, 'exTh') .'" data-content="'. get_pix_content($slide) .'"></div>';
}
?>
I have found some script, which get the content, but can’t implement it.
Here it is:
content: jQuery('#pix_credits_pictures').html(),
events: {
show: function(event, api) {
api.set('content.text', jQuery('#pix_credits_pictures').html());
}
},
You will need to modify the way the jQuery slider to include custom attributes for the images to include the title and the caption. Something like:
You can implement a more elegant solution for “storing” the titles and captions instead of an array, I guess that depends on the way your plugin works and how it is storing the images.
Next up you can access the title and captions using jQuery like so:
Obviously you will have to decide where exactly you want to use the title and when, but that is how you access them. The best way is probably to modify the slider library on the active image event.