Create Custom Widget

class ktree_rsssocial_Widget extends WP_Widget
{
function ktree_rsssocial_Widget()
{
global $themename;
parent::WP_Widget(false, ‘ktree – Rss Social Media Widget’);
}

function widget($args, $instance) {
extract($args);
$faccount = $instance[‘faccount’];
// $msaccount = $instance[‘msaccount’];
$twaccount = $instance[‘twaccount’];
$ytaccount = $instance[‘ytaccount’];
$title = $instance[‘title’];

echo $args[‘before_widget’];
echo $args[‘before_title’] . $title . $args[‘after_title’];

?>

  • <a target="_blank" href="”>
  • <a target="_blank" href="”>

<label for="get_field_id(‘title’); ?>”>
<input style="width: 200px;" id="get_field_id(‘title’); ?>” name=”get_field_name(‘title’); ?>” type=”text” value=”” />

<label for="get_field_id(‘faccount’); ?>”>
<input style="width: 200px;" id="get_field_id(‘faccount’); ?>” name=”get_field_name(‘faccount’); ?>” type=”text” value=”” />

<label for="get_field_id(‘twaccount’); ?>”>
<input style="width: 200px;" id="get_field_id(‘twaccount’); ?>” name=”get_field_name(‘twaccount’); ?>” type=”text” value=”” />

<label for="get_field_id(‘ytaccount’); ?>”>
<input style="width: 200px;" id="get_field_id(‘ytaccount’); ?>” name=”get_field_name(‘ytaccount’); ?>” type=”text” value=”” />

<?php

}

}

add_action('widgets_init', create_function('', 'return register_widget("ktree_rsssocial_Widget");'));

Advertisements
    • shivani
    • December 29th, 2011

    hello sir,pls give me some exaplanation on this..

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: