phprockers-logo

Simple way to create a widget in wordpress

1 comments
First Step: Goto this directory-localhost/yourwordpressname/wp-content/plugins.
Second Step: Create a folder for creating a widget in above directory.

Third Step: Inside the folder, Create a .php file and copy below codes.
Fourth Step: Goto wordpress administrator, see left sidebar, click plugins and activate your plugin.
Fifth Step: Finally Goto wordpress widget  and find the your widget name here. Then you have to use, where you want in widgetized area in wordpress.

Guides for creating a complete widgets in WordPress 3.3

0 comments
The first thing we have to do is load our widget when necessary. WordPress provides the widgets_init action hook that will allow us to do this. In WordPress 3.1, this action hook is fired right after the default WordPress widgets have been registered.

Note: This can be used to all wordpress versions


<?php

/**
* Plugin Name: Example Widget
* Plugin URI: http://phprockers.blogspot.com/p/wordpress.html
* Description: A widget that serves as an example for developing more advanced widgets.
* Version: 1.0
* Author: Ramakrishnan V.
* Author URI: http://phprockers.blogspot.com

*
*/

Uploading Files with PHP

1 comments
This script will allow you to upload files from your browser to your hosting, using PHP. The first thing we need to do is create an HTML form that allows people to choose the file they want to upload. 

<form enctype="multipart/form-data" action="upload.php" method="POST"> 
<lable> Please choose a file: </lable>
<input name="uploaded" type="file" /><br /> 
<input type="submit" value="Upload" /> 
</form> 
 
This form sends data to the file "upload.php". Then we can easily get the uploaded information using file function in upload.php.