Skip to content

Instantly share code, notes, and snippets.

@Fray117
Last active January 24, 2023 08:16
Show Gist options
  • Save Fray117/dfc03c515f235bd096cf8e52872789c5 to your computer and use it in GitHub Desktop.
Save Fray117/dfc03c515f235bd096cf8e52872789c5 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Floating Action
* Plugin URI: https://gist.github.com/Fray117/dfc03c515f235bd096cf8e52872789c5
*
* Description: Display a customizable floating widget
* Version: 0.6
* Author: SABAKO
* Author URI: https://sabako.id
*
*/
function floating_action_html() {
$link = 'https://linktr.ee/jasperskin';
$css = '
position: fixed;
bottom: 32px;
right: 32px;
background-color: #fff;
border-radius: 32px;
width: 64px;
height: 64px;
display: flex;
justify-content: center;
align-items: center;
font-size: 32px;
';
$html = '<div class="display-floating-btn" style="' . $css . '">
<a href="' . $link . '" style="margin: auto;">
<i class="fas fa-comment"></i>
</a>
</div>';
echo $html;
}
add_action( 'wp_footer', 'floating_action_html' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment