curl -L 'http://git.io/h1iuxQ' | sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Widget_Setup | |
{ | |
public $widget_class = ''; | |
public $admin_styles = array(); | |
public $admin_scripts = array(); | |
public $front_styles = array(); | |
public $front_scripts = array(); | |
public $script_defaults = array( | |
'handle' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once(ABSPATH . WPINC . '/feed.php'); | |
if(function_exists('fetch_feed')) { | |
$feed = fetch_feed('http://example.com/feed/'); | |
if (!is_wp_error($feed)) : $feed->init(); | |
$feed->set_output_encoding('UTF-8'); // set encoding | |
$feed->handle_content_type(); // ensure encoding | |
$feed->set_cache_duration(21600); // six hours in seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Google+ Feed | |
*/ | |
/** | |
* A WordPress page template for a Google+ feed. | |
* | |
* @author Dominik Schilling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
301 moved permanently (redirect): | |
<?php | |
header('HTTP/1.1 301 Moved Permanently'); | |
header('Location: http://www.example.com'); | |
die(); | |
?> | |
302 moved temporarily(redirect): | |
<?php | |
header('Location: http://www.example.com'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cache_image($image_url){ | |
//replace with your cache directory | |
$image_path = 'path/to/cache/dir/'; | |
//get the name of the file | |
$exploded_image_url = explode("/",$image_url); | |
$image_filename = end($exploded_image_url); | |
$exploded_image_filename = explode(".",$image_filename); | |
$extension = end($exploded_image_filename); | |
//make sure its an image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* requires jQuery | |
* usage: | |
* Scroller.to({ offset: 100 }); | |
* Scroller.to({ target: $('#main') }); | |
* | |
* advanced usage (with additional easing function not provided here) | |
* Scroller.to({ target: $('#main'), delay: 500, multiplier: 1.5, easing: 'easeOutQuad' }); | |
*/ | |
var Scroller = (function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* API Request Caching | |
* | |
* Use server-side caching to store API request's as JSON at a set | |
* interval, rather than each pageload. | |
* | |
* @arg Argument description and usage info | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="nl"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="icon" href="/favicon.ico"> | |
<!-- CSRF Token --> |
NewerOlder