⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📈📜📜📩⛅😰📩📜📈⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📝⛅😱🍰😱😰🐹⛅⛅⛅⛅📩📜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📈🐹🚌😱😰😰🌓💌😱📝⛅😱🚌🙊🐵🚌⛅📜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📜🐹📔😱😰😱🚌📦🍝🍝🐹🐹🚌🍮🐵🎊🚀📺🚌🎂⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🐹🚌😱🌓😱🍝🍮🍱🔒🍝📦📦📦📦🍝🍝🍝🍱💼🍮😱📜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📈🍰🍝🍰😱🚌🚌🍮🔒🐹😱😱📦📦🍝🚌📦🐹🍰🍝🍱🍱🍝🐹📜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📈🍝🍝🍝🍮🍱🍮🍱🎊🍱🍰😱📦🍝🍝🍝🔒🚌🐹📦🍝🍧🍝🍝🚌😰⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
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
// Get any existing copy of our transient data | |
if ( false === ( $special_query_results = get_transient( 'special_query_results' ) ) ) { | |
// It wasn't there, so regenerate the data and save the transient | |
$special_query_results = new WP_Query( 'cat=5&order=random&tag=tech&post_meta_key=thumbnail' ); | |
set_transient( 'special_query_results', $special_query_results, 12 * HOUR_IN_SECONDS ); | |
} | |
// Use the data like you would have normally... |
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
if ( false === ( $sidebar_popular_chartbeat = get_transient( 'sidebar_popular_chartbeat' ) ) ) { | |
$sidebar_popular_chartbeat = wp_remote_get("http://api.chartbeat.com/live/toppages/v3/?apikey=XXXXX&host=yourwebsite.com"); | |
set_transient( 'sidebar_popular_chartbeat', $sidebar_popular_chartbeat, 600 ); | |
} |
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
$sidebar_popular_chartbeat = wnet_get_transient_remote_json('sidebar_popular_chartbeat', 'http://api.chartbeat.com/live/toppages/v3/?apikey=XXXXX&host=yourwebsite.com', 600); |
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
function wnet_get_transient_remote_json($transientname, $url, $interval=1800) { | |
// those are the same arguments as 'set_transient()' | |
$stalecachename = 'stalecache_' . $transientname; | |
// we generate a consistent name for the backup data | |
if ( false === ( $json = get_transient($transientname) ) ) { | |
$response = wp_remote_get($url); | |
// get the remote data as before, but this time... |
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 | |
/* | |
* Plugin Name: Theme Settings | |
* Version: 1 | |
* Plugin URI: http://ieg.wnet.org/ | |
* Description: Create a theme settings page | |
* Author: Alexandra White | |
* Author URI: http://ieg.wnet.org/blog/author/whitea/ | |
* Requires at least: 3.6 | |
* Tested up to: 4.2.2 |
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 | |
/** General add scripts **/ | |
function adding_scripts_to_footer() { | |
// jQuery is already a part of the WP library. See: https://developer.wordpress.org/reference/functions/wp_enqueue_script/ | |
wp_enqueue_script('jquery'); | |
// Additional scripts, it's best to always register and then enqueue | |
wp_register_script('my_amazing_script', plugins_url('../js/amazing_script.js', _FILE_), array('jquery'), '1.1', true); | |
wp_enqueue_script('my_amazing_script'); |
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> | |
<head> | |
<title>My website</title> | |
<!-- Normalize --> | |
<link rel='stylesheet' id='main' href='css/normalize.css' type='text/css' media='all' /> | |
<!-- Custom CSS --> | |
<link rel='stylesheet' id='main' href='css/style.css' type='text/css' media='all' /> | |
</head> |
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
/************************************************************ | |
NORMALIZE CSS | |
Do not touch the CSS between these line breaks | |
**********************************************************/ | |
/*! normalize.css v7.0.0 | MIT License */ | |
button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}progress,sub,sup{vertical-align:baseline}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub, |
OlderNewer