WordPress

Following are List of Word Press Topics.

1) Add Podcast Plugin into WordPress Blog
     PodCasting is distributing audio or video content through RSS feed and atom into a site. main purpose of pod casting is to share audio and video with viewers. here we discuss about popular plugin "Blubrry Powerpress" for podcast at word press (2.8,3.0 or above) site . its simple to use, first download the powerpress.2.0.2.zip from  http://www.blubrry.com/ then unzip the file and upload it to wp-content/plugins/. logged into WordPress admin go to plugin menu and activate the powerpress plugin. you will see that a new admin tab menu "PowerPress" will be visible at bottom. now click on Settings sub-menu link at PowerPress menu here you will saw various setting menu you had to set each one according to your means for example you want to add previous post with Podcast set the PodPress Episodes to include previous post, set Default Media URL as path http://example.com/wp-content/uploads/.  don't forgot to select Audio and video Player (Links below the sub-menu  Settings).
             Now Create a new Post , there you saw at bottom podcast episode here at this section you can add media files or online URL to that Post.

Also you can display the Audio and video Player at your Custom or default Theme. download single.php via FTP from wp-content/themes/<theme folder>
Add the following PHP code After <h1 class="entry-title">Title</h1>
<?php
                      //Podcast link added by developer ...start..
                        if( $episode_content = get_the_powerpress_content() ) { ?>
                     <fieldset class="episode-box">
                     <legend>Podcast Episode</legend>
                     <?php echo $episode_content; ?>                     
                     </fieldset>
                    <?php } //end ... 
?>
Add following CSS into style.css file
/* Podcast Bulburry css */
.episode-box {
 background-color: #FFFFFF; /*#ECECEC;*/
 border: 1px solid #4281B7;
 padding: 6px 6px 2px 6px;
 margin: 3px 0 0 5px;
 position: relative;
 width:300px;

 -moz-border-radius: 5px;
 -khtml-border-radius: 5px;
 -webkit-border-radius:5px;
 border-radius: 5px;
 -moz-box-sizing: content-box;
 -webkit-box-sizing: content-box;
 -khtml-box-sizing: content-box;
 box-sizing: content-box;
}
.episode-box p {
 margin: 0;
 padding: 0;
 font-size: 90%;
}
/* css end for podcast */
Above will display audio or video play at details page of a Post, if that post had an attached media file at the time of creation of editing.

2) Create Plugins For WordPress Blog
      WordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins. i had develop a wordpress site for a restaurant and add a plugin to create a custom menu to add food menus. here are the steps to create and attached a plugin to create a Custom admin menu to Word Press. you can also get help from http://codex.wordpress.org/Writing_a_Plugin
      a) First i create a php file and name it say foodmenu.php, this file would be my main plugin file. open that file in a editor and at top i insert the following code.
<?php
/**
 * @package Food_menu
 * @version 1.0
 */
/*
Plugin Name: Food Menu
Plugin URI: http://wordpress.org/extend/plugins/food_menu/
Description: This is not just a plugin, it is used to add top level menu food menu at Admin menu panel.
Author: Dipankar
Version: 1.1
Author URI: http://blitzphp.blogspot.com/
*/
?> 
Above Code  will tell that this foodmenu.php is the main plugin file and this file when uploaded and saved in wp-content/plugins/    folder  will automatically get displayed at plugins menu in admin panel.
now add code below the above commented lines
<?php
add_action('admin_menu', 'my_plugin_menu');

function my_plugin_menu() {
    //add_options_page('My Plugin Options', 'My Plugin to display at dashboard', 'manage_options', 'my-unique-identifier', 'my_plugin_options');
    $userid = get_current_user_id();  //this function will get current logged in user, admin id is 1
    

add_menu_page('Food Menu', 'Food Menu','manage_options', 'food-menu', 'my_magic_function1');
add_menu_page('Restaurant Detail', 'Restaurant Detail','manage_options', 'rest-detail', 'my_magic_function');   
   
}

?>
add_action fires an action when ever plugin file gets executed, it a hook function, "admin_menu" indicates to add menus at admin side. refer http://codex.wordpress.org/Administration_Menus
my_plugin_menu is the function to be called when add_action gets executed. now let see that details of my_plugin_menu function. you can see
add_menu_page('Food Menu','Food Menu','Manage_Options','food_menu','my_magic_function1'); 
add_menu_page('My Plugin Options', 'My Plugin to display at dashboard', 'manage_options', 'my-unique-identifier', 'my_plugin_options');
where add_menu_page() will add new Custom menu at Admin side left panel, "Food Menu" is the menu name to be displayed at admin panel. manage_option is the default option for roles, "my_magic_function1" is a function gets called when Food Menu menu is clicked at Admin panel.


<?php
function my_magic_function1() {   
    echo '<div class="wrap">';
    echo '<p>Here is where the form would go if I actually had options.</p>';
    echo '</div>'; 
    //include("restmenu.php");
}
?>
Now save at put this file inside wp-content/plugins/   give it 0777 permission and then logged into admin panel go to plugin you can saw the Food Menu plugin showing at list, activate it. then after you can saw to menus emerging at bottom of left side menu panel.

3) Diffrence between Plugin and Widgets
A WordPress plugin allows a Blogger to add a function to his or her blog by downloading a software script.  Some of the popular plugins allow for better SEO, Adsense placement, sharing of posts, contact form generator and much more.  There are literally thousands of plugins you can download for free that will make your blog more powerful.  Some plugins are visible to the viewer of your blog while others are for the back-end where only you can see they are present.
A WordPress widget is an object you can add to your sidebar usually derived from a plugin.  Under “Appearance” is the “Widgets” section, you can simply drag and drop objects into your sidebar.  When you upload Worpdress onto your server you will have some widgets that are already available such as a search box and category section.  A widget is very important for your blog because the sidebar is where the action is other than your content.  A well organized sidebar is essential for reader interaction, advertising placement and an area for your readers to explore other content on your blog.
The short answer: A widget is a plugin that you can drag and drop in your sidebar.  A plugin is a script that you download that improves the function of your blog in your front-end or back-end.

4) Header error in plugin while actvating
How to solved the “The plugin generated 146 characters of unexpected output during activation” problem
open wp-admin/includes/plugin.php in your favorite editor. go to the bootom of the page and following code below

add_action('activated_plugin','save_error');

function save_error(){
    update_option('plugin_error',  ob_get_contents());
}

when we activate activate the plugin above hook will get the error and save to to wp_option table.
from there you can saw the error.. or
echo get_option('plugin_error');
in plugin file