Sitede kullandığım wp content slide eklentisine eklenen resimlere alt etiketi nasıl ekleyebilirim. Eklenti sayfasında sadece resmin adresi ve açılacak adres girilebiliyor...
Aşağıdaki kodlar eklentinin content_slide.php dosyasında yer alıyor. Muhtemelen buraya yapılacak bir ilaveyle alt etiketi eklenebilir ama ben yapamadım. Slayta eklenecek tüm resimlerin ortak bir alt etiketi olsa da olur. Nasıl yapabiliriz?
/*
Plugin Name: Content Slide Plugin
Plugin URI: http://www.snilesh.com/resources/wordpress/wordpress-plugins/wordpress-content-slide-plugin/
Description: Wordpress plugin for simple slideshow.
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YKY7SHDT8GTQG
Version: 1.4.2
Author: Snilesh
Tags: images, gallery, slideshow, photos, post, jquery slideshow,jquery innerfade,innerfade,coin,coin slider,coinslider,swirl gallery,random gallery,banner,rotating banners,ads,rotating ads,image slide,content slider,nivo slider,image rotator,content rotator,image slider
Author URI: http://www.snilesh.com
*/
/* Copyright 2010 Snilesh.com (email : snilesh.com@gmail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
global $wp_version;
$exit_msg='Wordpress Content Slide This requires WordPress 2.9 or newer. Please update!';
$WPContent_slide_plugin_url=defined('WP_PLUGIN_URL') ? (WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
if (version_compare($wp_version,"2.9","<"))
{
exit ($exit_msg);
}
if (!defined('WP_CONTENT_URL')) {
define('WP_CONTENT_URL', get_option('siteurl').'/wp-content');
}
define('CONTENT_SLIDE_URL',get_option('siteurl').'/wp-content/plugins/content-slide/');
global $content_slider_defaults;
global $wpcs_settings;
$wpcs_settings=get_option('wpcs_options');
$content_slider_defaults=array(
'width'=>500, // width of slider panel
'height'=>300, // height of slider panel
'square_per_width'=>7, // squares per width
'square_per_height'=>5, // squares per height
'delay'=>3000, // delay between images in ms
'sDelay'=>30, // delay beetwen squares in ms
'opacity'=>'0.7', // opacity of title and navigation
'titleSpeed'=>500, // speed of title appereance in ms
'effect'=>'random', // random, swirl, rain, straight, fade using innerfade.
'navigation'=>'true', // prev next and buttons
'links'=>'true', // show images as links
'hoverPause'=>'true', // pause on hover
'slide_image1'=>WP_CONTENT_URL.'/plugins/content-slide/images/image1.jpg',
'slide_image2'=>WP_CONTENT_URL.'/plugins/content-slide/images/image2.jpg',
'slide_image3'=>WP_CONTENT_URL.'/plugins/content-slide/images/image3.jpg',
'slide_image4'=>WP_CONTENT_URL.'/plugins/content-slide/images/image4.jpg',
'slide_image5'=>WP_CONTENT_URL.'/plugins/content-slide/images/image5.jpg',
'slide_imagelink1'=>'http://www.snilesh.com/resources/jquery/jquery-image-slider/',
'slide_imagelink2'=>'http://www.snilesh.com/resources/wordpress/wordpress-tips-and-tricks/wordpress-show-title-and-excerpt-of-child-pages-on-parent-page/',
'slide_imagelink3'=>'http://www.snilesh.com/resources/wordpress/wordpress-plugins/wordpress-news-ticker-plugin/',
'slide_imagelink4'=>'http://www.snilesh.com/resources/jquery/jquery-image-sliders-2010/',
'slide_imagelink5'=>'http://www.snilesh.com/resources/jquery/jquery-dynamic-selectbox/',
'font_family'=>'Arial,Georgia,Verdana',
'font_size'=>12,
'heading_font'=>18,
'heading_color'=>'#ffffff',
'background_color'=>'#ffffff',
'number_of_posts'=>4,
'border_width'=>5,
'border_color'=>'#ffffff',
'color'=>'#000000',
'custom_image'=>'true',
'post_category'=>'',
'show_excerpt'=>'false',
'char_length'=>200,
'no_of_custom_images'=>5,
'navigation_color'=>'#000000',
'navigation_next_previous'=>'true',
'navigation_buttons'=>'true',
'order'=>'false',
'new_window'=>'false'
);
register_deactivation_hook(__FILE__, 'wpcs_slide_deactivate' );
register_activation_hook(__FILE__, 'wpcs_slide_activate');
function wpcs_slide_deactivate()
{
// delete_option('wpcs_options');
}
function wpcs_slide_activate()
{
global $content_slider_defaults,$values;
$default_settings = get_option('wpcs_options');
$default_settings= wp_parse_args($default_settings, $content_slider_defaults);
add_option('wpcs_options',$default_settings);
}
/* Add Administrator Menu's*/
function wpcs_content_slide_menu()
{
$level = 'level_10';
add_menu_page('Content Slide', 'Content Slide', $level, __FILE__,'wpcs_content_slide_options',CONTENT_SLIDE_URL.'images/icon6.png');
add_submenu_page(__FILE__, 'Help & Support', 'Help & Support', $level,'wpcs_content_slide_help','wpcs_content_slide_help');
}
add_action('admin_menu', 'wpcs_content_slide_menu');
function wpcs_content_slide_options()
{
wpcs_settings_update();
include_once dirname(__FILE__).'/options_page.php';
}
function wpcs_settings_update()
{
if(isset($_POST['wpcs_options']))
{
echo 'Content Slide Settings Updated
';
unset($_POST['update']);
update_option('wpcs_options', $_POST['wpcs_options']);
}
}
function wpcs_content_slide_help()
{
include_once dirname(__FILE__).'/help_support.php';
}
if ( function_exists('add_theme_support') ) {
$plug_options=get_option('wpcs_options');
add_theme_support('post-thumbnails');
add_image_size( 'content-slide-thumbnail', $plug_options['width'], $plug_options['height'] );
}
/*Limit content posts*/
function wpcs_content_slider_limitpost ($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
if (strlen($_GET['p']) > 0) {
echo $content;
echo " ".__('Read More', 'vibe')." →";
}
else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
$content = substr($content, 0, $espacio);
$content = $content;
echo $content;
echo "...";
echo " ".$more_link_text."";
}
else {
echo $content;
echo " ".__('Read More', 'vibe')." →";
}
}
// ADD Content Slide JS TO HEAD SECTION
add_action('wp_print_scripts', 'wpcs_content_slider_user_scripts');
function wpcs_content_slider_user_scripts() {
global $wpcs_settings;
wp_enqueue_script ('jquery');
if($wpcs_settings['effect']=='fade')
{
wp_enqueue_script('content_slider', CONTENT_SLIDE_URL.'js/jquery.innerfade.js', $deps = array('jquery'));
}
else
{
wp_enqueue_script('content_slider', CONTENT_SLIDE_URL.'js/coin-slider.js', $deps = array('jquery'));
}
}
add_action('wp_head', 'wpcs_content_slider_header');
function wpcs_content_slider_header() {
global $wpcs_settings; ?>
<script>
var $jquery = jQuery.noConflict();
$jquery(document).ready(function()
{
$jquery('#wpcontent_slider').coinslider(
{
width: ,
height: ,
spw: ,
sph: ,
delay: ,
sDelay: ,
opacity: ,
titleSpeed: ,
effect: '',
navigation: true,
links : true,
hoverPause: });
$jquery('#wpcontent_slider').innerfade({
speed: 2000,
timeout: 6000,
type: 'sequence',
containerheight: 'px'
});
}?>
});
</script>
function wp_content_slider()
{
global $wpcs_settings;
$total_width=$wpcs_settings['width']+$wpcs_settings['border_width']+$wpcs_settings['border_width'];
echo '';
if($wpcs_settings['custom_image']=='false')
{
if($wpcs_settings['order']=='true')
{
$tmp='orderby=rand&';
}
else
{
$tmp='';
}
$recent_posts = new WP_Query($tmp."cat=".$wpcs_settings['post_category'].'&showposts='.$wpcs_settings['number_of_posts']);
$count=0;
while($recent_posts->have_posts()) : $recent_posts->the_post(); ?>
if(has_post_thumbnail()) {
$new_window='';
if($wpcs_settings['new_window']=='true')
{
$new_window=' target="_blank"';
}
?>
>
}
else
{
continue;
}
?>
wp_reset_query();
}
else
{
$custom_images=array();
$temp_array=array();
for($j=1;$j<=$wpcs_settings['no_of_custom_images'];$j++)
{
$temp_array=array('image_src'=>$wpcs_settings['slide_image'.$j],'image_link'=>$wpcs_settings['slide_imagelink'.$j],'heading'=>$wpcs_settings['slide_imageheading'.$j],'text'=>$wpcs_settings['slide_imagetext'.$j]);
array_push($custom_images,$temp_array);
}
if($wpcs_settings['order']=='true')
{
shuffle($custom_images);
}
foreach($custom_images as $images)
{
if($images['image_link']!='')
{
$new_window='';
if($wpcs_settings['new_window']=='true')
{
$new_window=' target="_blank"';
}
?>
>
}
?>
$images['heading']=stripslashes($images['heading']);
$images['text']=stripslashes($images['text']);
?>
if($images['image_link']!='')
{
?>
}
}
}
echo '';
echo '';
?>
}
?>