siteme sosyal medya ikonları koydum ama farklı pencerede açılma işini bi beceremedim. Bilen var mıdır?
*/
if( $newTwitter ){
echo ''. $getNew .''. __('Followers' , 'bd' ) .' ';
}
/**
target="_blank" neden çalışmaz? |
7 Mesajlar | 1.204 Okunma |
*/
if( $newTwitter ){
echo ''. $getNew .''. __('Followers' , 'bd' ) .' ';
}
/**
if( $newTwitter ){
echo ''. $getNew .''. __('Followers' , 'bd' ) .' ';
}
if( $newTwitter ){
echo ''. $getNew .''. __('Followers' , 'bd' ) .' ';
}
if( $newTwitter ){
echo ''. $getNew .''. __('Followers' , 'bd' ) .' ';
}
Böyle deneyin.
/**
* Social Counter
*/
add_action( 'widgets_init', 'bd_counter_widget' );
function bd_counter_widget(){
register_widget( 'bd_counter_widget' );
}
class bd_counter_widget extends WP_Widget
{
function bd_counter_widget()
{
$widget_ops = array( 'classname' => 'bd-counter-widget', 'description' => '' );
$control_ops = array( 'id_base' => 'bd-counter-widget' );
$this->WP_Widget( 'bd-counter-widget', theme_name . ' - Social Counter', $widget_ops, $control_ops );
}
function widget( $args, $instance )
{
extract( $args );
$title = apply_filters('widget_title', $instance['title'] );
$count = new COUNT_CLASS();
$rssurl = $instance['rssurl'];
$twitter_un = $instance['twitterun'];
$facebookn = $instance['facebookn'];
$gplusn = $instance['gplusn'];
$youtubeun = $instance['youtubeun'];
$vimocn = $instance['vimocn'];
$soundcloudun = $instance['soundcloudun'];
$socialstyle - $instance['socialstyle'];
$social_count['twitter'] = $count->get_twitter_count( $twitter_un );
$social_count['facebook'] = $count->get_facebook_count( $facebookn );
$social_count['gplus'] = $count->get_gplus_count( $gplusn );
$social_count['youtube'] = $count->get_youtube_count( $youtubeun );
$social_count['vimo'] = $count->get_vimo_count( $vimocn );
$social_count['soundcloud'] = $count->get_soundcloud_count( $soundcloudun );
$getNew = getTwitterFollowers();
$getNewName = bdayh_get_option('twitter_username');
$newTwitter = $instance['twitter'];
?>
}
function update( $new_instance, $old_instance )
{
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title']);
$instance['rssurl'] = $new_instance['rssurl'] ;
$instance['twitterun'] = $new_instance['twitterun'] ;
$instance['facebookn'] = $new_instance['facebookn'] ;
$instance['gplusn'] = $new_instance['gplusn'] ;
$instance['youtubeun'] = $new_instance['youtubeun'] ;
$instance['vimocn'] = $new_instance['vimocn'] ;
$instance['soundcloudun'] = $new_instance['soundcloudun'] ;
$instance['socialstyle'] = $new_instance['socialstyle'] ;
$instance['twitter'] = strip_tags($new_instance['twitter']);
delete_transient('bdTwitterFollowers');
delete_transient('bdayh_soical_soundcloud');
delete_transient('bdayh_soical_vimo');
delete_transient('bdayh_soical_youtube');
delete_transient('bdayh_soical_gplus');
delete_transient('bdayh_soical_facebook');
return $instance;
}
function form( $instance )
{
$defaults = array('title' =>__( 'Social Counter' , 'bd'));
$instance = wp_parse_args((array) $instance, $defaults);
?>
$consumer_key = bdayh_get_option('twitter_consumer_key');
$consumer_secret = bdayh_get_option('twitter_consumer_secret');
$twitter_id = bdayh_get_option('twitter_username');
if( empty($twitter_id) && empty($consumer_key) && empty($consumer_secret) )
echo 'Error : Setup Twitter API settings Go to Theme panel > Advanced Settings > Twitter API OAuth Settings .
';
?>
type="checkbox" />
}
}
Ek Olarak: siz hangi linki yeni pencerede açmak istiyorsunuz ona göre kod yazalım.
haberdaret.net'teki sağdaki sosyal medya butonları yeni pencerede açılsın istiyorum. kodlar aşağıdaki gibi...
/**
* Social Counter
*/
add_action( 'widgets_init', 'bd_counter_widget' );
function bd_counter_widget(){
register_widget( 'bd_counter_widget' );
}
class bd_counter_widget extends WP_Widget
{
function bd_counter_widget()
{
$widget_ops = array( 'classname' => 'bd-counter-widget', 'description' => '' );
$control_ops = array( 'id_base' => 'bd-counter-widget' );
$this->WP_Widget( 'bd-counter-widget', theme_name . ' - Social Counter', $widget_ops, $control_ops );
}
function widget( $args, $instance )
{
extract( $args );
$title = apply_filters('widget_title', $instance['title'] );
$count = new COUNT_CLASS();
$rssurl = $instance['rssurl'];
$twitter_un = $instance['twitterun'];
$facebookn = $instance['facebookn'];
$gplusn = $instance['gplusn'];
$youtubeun = $instance['youtubeun'];
$vimocn = $instance['vimocn'];
$soundcloudun = $instance['soundcloudun'];
$socialstyle - $instance['socialstyle'];
$social_count['twitter'] = $count->get_twitter_count( $twitter_un );
$social_count['facebook'] = $count->get_facebook_count( $facebookn );
$social_count['gplus'] = $count->get_gplus_count( $gplusn );
$social_count['youtube'] = $count->get_youtube_count( $youtubeun );
$social_count['vimo'] = $count->get_vimo_count( $vimocn );
$social_count['soundcloud'] = $count->get_soundcloud_count( $soundcloudun );
$getNew = getTwitterFollowers();
$getNewName = bdayh_get_option('twitter_username');
$newTwitter = $instance['twitter'];
?>
}
function update( $new_instance, $old_instance )
{
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title']);
$instance['rssurl'] = $new_instance['rssurl'] ;
$instance['twitterun'] = $new_instance['twitterun'] ;
$instance['facebookn'] = $new_instance['facebookn'] ;
$instance['gplusn'] = $new_instance['gplusn'] ;
$instance['youtubeun'] = $new_instance['youtubeun'] ;
$instance['vimocn'] = $new_instance['vimocn'] ;
$instance['soundcloudun'] = $new_instance['soundcloudun'] ;
$instance['socialstyle'] = $new_instance['socialstyle'] ;
$instance['twitter'] = strip_tags($new_instance['twitter']);
delete_transient('bdTwitterFollowers');
delete_transient('bdayh_soical_soundcloud');
delete_transient('bdayh_soical_vimo');
delete_transient('bdayh_soical_youtube');
delete_transient('bdayh_soical_gplus');
delete_transient('bdayh_soical_facebook');
return $instance;
}
function form( $instance )
{
$defaults = array('title' =>__( 'Social Counter' , 'bd'));
$instance = wp_parse_args((array) $instance, $defaults);
?>
$consumer_key = bdayh_get_option('twitter_consumer_key');
$consumer_secret = bdayh_get_option('twitter_consumer_secret');
$twitter_id = bdayh_get_option('twitter_username');
if( empty($twitter_id) && empty($consumer_key) && empty($consumer_secret) )
echo 'Error : Setup Twitter API settings Go to Theme panel > Advanced Settings > Twitter API OAuth Settings .
';
?>
type="checkbox" />
}
}
/**
* Twitter
*/
if( $newTwitter ){
echo '
}
/**
* Facebook
*/
if( $social_count['facebook'] ):
echo '
endif;
/**
* Feed
*/
if( $rssurl ):
echo '
endif;
/**
* Google+
*/
if( $social_count['gplus'] ):
echo '
endif;
/**
* Youtube
*/
if( $social_count['youtube'] ):
echo '
endif;
/**
* Vimeo
*/
if( $social_count['vimo'] ):
echo '
endif;
/**
* Souncloud
*/
if( $social_count['soundcloud'] ):
echo '
endif;
?>