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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Form Process | |
|-------------------------------------------------------------------------- | |
*/ | |
if(isset($_POST['submitted'])) { | |
if(trim($_POST['contactName']) === '') { | |
$nameError = 'Please enter your name.'; |
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
<h3>Pages</h3> | |
<ul><?php wp_list_pages("title_li=" ); ?></ul> | |
<h3>Feeds</h3> | |
<ul> | |
<li><a title="Full content" href="feed:<?php bloginfo('rss2_url'); ?>">Main RSS</a></li> | |
<li><a title="Comment Feed" href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comment Feed</a></li> | |
</ul> | |
<h3>Categories</h3> | |
<ul><?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0&feed=RSS'); ?></ul> | |
<h3>All Blog Posts:</h3> |
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 $args = array( | |
'numberposts' => -1, | |
'offset' => 0, | |
'orderby' => 'post_date', | |
'order' => 'DESC', | |
'post_type' => 'custom_post_type_here', | |
'post_status' => 'publish', | |
'meta_query' => array( | |
array( | |
'key' => 'custom_field_key_name', |
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 | |
/* Place the file into WordPress root folder and open the file in your browser. */ | |
/* Settings */ | |
define( 'BLOG_TITLE', 'WordPress Dev' ); | |
define( 'USER_NAME', 'admin' ); | |
define( 'USER_EMAIL', 'foobar@example.com' ); | |
define( 'USER_PASSWORD', '123456' ); | |
define( 'WP_SITEURL', 'http://wp.dev' ); |
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
ol.chapters { | |
list-style: none; | |
margin-left: 0; | |
} | |
ol.chapters > li:before { | |
content: counter(chapter) ". "; | |
counter-increment: chapter; | |
font-weight: bold; | |
float: left; |
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
// jQuery wrapper | |
var cacheQuery = function(query) { | |
this.cache = this.cache || {}; | |
if (!this.cache[query]) { | |
this.cache[query] = jQuery(query); | |
} | |
return this.cache[query]; | |
}; |
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
// optimized http://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics | |
(function(G,o,O,g,l){G.GoogleAnalyticsObject=O;G[O]||(G[O]=function(){(G[O].q=G[O].q||[]).push(arguments)});G[O].l=+new Date;g=o.createElement('script'),l=o.scripts[0];g.src='//www.google-analytics.com/analytics.js';l.parentNode.insertBefore(g,l)}(this,document,'ga')); | |
ga('create','UA-XXXXXXXX', 'auto'); | |
// Enhanced Link Attribution: | |
// https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#enhancedlink | |
// https://support.google.com/analytics/answer/2558867?hl=en | |
ga('require', 'linkid', 'linkid.js'); |
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
/** | |
* Load javascript resources asynchronously. Accepts additional parameters that can be passed to the specified callback function | |
* Author: Frederick King | |
* Date: 3/8/2012 | |
* References/Credits : http://css-tricks.com/thinking-async/ , http://mathiasbynens.be/notes/async-analytics-snippet | |
* | |
**/ | |
var async_load_js = function( url, callback ){ | |
var js, args, rs, s; |
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
<html> | |
<head> | |
<title>LazyLoading Test</title> | |
<script> | |
var AsyncLoader = function(src, cb) { | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.src = src + '?=' + Math.random(); // make sure we are loading this once | |
if(typeof(cb) == '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
(function() { | |
function async_load(){ | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.src = 'http://yourdomain.com/script.js'; | |
var x = document.getElementsByTagName('script')[0]; | |
x.parentNode.insertBefore(s, x); | |
} | |
if (window.attachEvent) { |
OlderNewer