This is my first time building a plugin for WordPress. I got the basics down but now I am trying to display a div on the bottom right corner, more like a small pop-up on the bottom right side of the front page only. The PHP code that I've uploaded did not work, it kept crashing my website.
Where is my mistake?
Please explain your answers. Thank you!
Code:
<?php
/*
Plugin Name: My First Plugin
Plugin URL: http://ift.tt/1VC3cMl
Description: An awesome facebook popup plugin that will amaze you!
Author: Martin
Version: 1.0
Author URL: http://ift.tt/1VC3cMl
*/
add_action('admin_menu', 'myfirstplugin_admin_actions');
function myfirstplugin_admin_actions() {
add_options_page('MyFirstPlugin', 'MyFirstPlugin', 'manage_options', __FILE__, 'myfirstplugin_admin');
}
function myfirstplugin_admin()
{
?>
<style>
.wrap {
width:100%;
height:auto;
}
.popup {
position:fixed;
bottom:0;
right:0;
width:325px;
height:200px;
background-color:#09f;
}
</style>
<div class="wrap">
<h1>Hello World!</h1><br>
<h4>Hope you like my awesome popup!</h4>
</div>
<?php if(is_front_page()) {
<div class="popup">Testing Div Tag On The Bottom Right Corner...</div>
}
?>
<?php
}
?>
via Chebli Mohamed