4

I am getting started with plugin development. I wrote the following program to display text on screen but nothing happened. Please help. Thanks.

<?php
/*
Plugin Name: Fahad
Plugin URI:
Description: Declares a plugin that will be visible in the
WordPress admin interface
Version: 1.0
Author: Yannick Lefebvre
Author URI: http://ylefebvre.ca
License: GPLv2
*/
?>


function fahad(){
    echo "I am alive";
}
add_filter('wp-footer', fahad);
6

A subtle difference between your syntax wp-footershould be wp_footer, underscore _ and not hypthen -

add_filter('wp-footer', fahad);   // wrong...

add_filter('wp_footer', 'fahad'); // right..

Follow the naming convention of functions:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy