Skip to content

Instantly share code, notes, and snippets.

View mustardamus's full-sized avatar

Sebastian Senf mustardamus

View GitHub Profile
//bind a click on #demo link and append the iframe in a div to the body, style the overlay
$(document).ready(function() {
var winWidth = $(window).width(); //get the current window width
var winHeight = $(window).height(); //get the current window height
var edgeSpace = 40; //we want the overlay to be 40px away from the edge
var iframeWidth = winWidth - edgeSpace * 2; //calculate the actual width of the iframe
var iframeHeight = winHeight - edgeSpace * 2; //calculate the actual height of the iframe
$('#demo').click(function() { //bind a click event to the #demo link
//append the overlay div with the iframe in it to the body
//adding a close button to the overlay and bind a click on it to close the overlay
$(document).ready(function() {
var winWidth = $(window).width();
var winHeight = $(window).height();
var edgeSpace = 40;
var iframeWidth = winWidth - edgeSpace * 2;
var iframeHeight = winHeight - edgeSpace * 2;
$('#demo').click(function() {
//add a close anchor inside the overlay div
//resize the iframe when the window is resized
$(document).ready(function() {
function refreshSettings() { //update the settings when calling this function
winWidth = $(window).width();
winHeight = $(window).height();
edgeSpace = 40;
iframeWidth = winWidth - edgeSpace * 2;
iframeHeight = winHeight - edgeSpace * 2;
}
//check for the OS, if we are on a mac align the close button to the left, otherwise to the right
$(document).ready(function() {
function refreshSettings() {
winWidth = $(window).width();
winHeight = $(window).height();
edgeSpace = 40;
iframeWidth = winWidth - edgeSpace * 2;
iframeHeight = winHeight - edgeSpace * 2;
}
<div class="navigation">
<?php if(function_exists("wp_pagenavi")) : ?>
<?php wp_pagenavi(); ?>
<?php else : ?>
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
<?php endif; ?>
</div>
<?php
$plugins = array(
array(
"name" => "Plugin-1",
"function" => "plugin_1",
"plugin" => "plugin-1"
),
array(
"name" => "Plugin-2",
"function" => "plugin_2",
<?php
$plugins = array(
array(
"name" => "WP-PageNavi",
"function" => "wp_pagenavi",
"plugin" => "wp-pagenavi"
)
);
?>
include "requiredplugins.php";
add_action("wp_head", "includePluginCss");
add_action("wp_footer", "outputPluginOverlay");
function includePluginCss() {
global $plugins;
foreach($plugins as $plugin) {
if(!function_exists($plugin["function"])) {
include "requiredplugins.php";
add_action("wp_head", "includePluginCss");
add_action("wp_footer", "outputPluginOverlay");