I am new to plugin development in wordpress.
I want to add just a simple html code to wp_footer using action hook I just learned from wordpress codex.
<?php
/*
Plugin Name: test
Plugin URI: http://mysite.com
Description: test
Version: 1.0
Author: me
Author URI: http://mysite.com
*/
function addbar(){
echo '<div id="cbar">';
echo '</div>';
}
if ( is_user_logged_in() ){
add_action('wp_footer','addbar');
} else {
}
?>
This code does not works , it crashes my site.