Skip to content

Instantly share code, notes, and snippets.

<div class="site-content large-8 columns" role="main">
<div class="error-search row">
<div class="large-12 columns">
<h1>The page your trying to reach doesn't exist.</h1>
<div class="panel">
<p>Search in the box below, or selecting an option from the menu above.</p>
<form><input type="text" class="site-search" name="s" value="" placeholder="Enter Search Term Here"><input type="submit" class="button small rounded mag-glass" value=""></form>
</div>
$counter = 0;
$ref_month = '';
$monthly = new WP_Query(array('posts_per_page' => 10));
if( $monthly->have_posts() ) : while( $monthly->have_posts() ) : $monthly->the_post();
if( get_the_date('mY') != $ref_month ) {
if( $ref_month ) echo "\n".'</ul>';
echo "\n".'<h6>'.get_the_date('F').'</h6>';
echo "\n".'<ul>';
$ref_month = get_the_date('mY');
if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT']))
{
echo '<link rel="stylesheet" href="'.site_url( 'dr-content/themes/dr' ) . '/css/main.css?ver='.$versionNum.'" type="text/css" media="all" />';
}
else {
wp_enqueue_style( 'dr-main-css', site_url( 'dr-content/themes/dr' ) . '/css/main.css', array(), $versionNum );
}
public function main_css() {
$versionNum = '2.0';
if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])) {
echo '<link rel="stylesheet" href="'.site_url( 'dr-content/themes/dr' ) . '/css/main.css?ver='.$versionNum.'" type="text/css" media="all" />';
}
else {
wp_enqueue_style( 'dr-main-css', site_url( 'dr-content/themes/dr' ) . '/css/main.css', array(), $versionNum );
}
}
<span data-picture data-alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
<span data-src="small.jpg"></span>
<span data-src="small_x2.jpg" data-media="(min-device-pixel-ratio: 2.0)"></span>
<span data-src="medium.jpg" data-media="(min-width: 400px)"></span>
<span data-src="medium_x2.jpg" data-media="(min-width: 400px) and (min-device-pixel-ratio: 2.0)"></span>
<span data-src="large.jpg" data-media="(min-width: 800px)"></span>
<span data-src="large_x2.jpg" data-media="(min-width: 800px) and (min-device-pixel-ratio: 2.0)"></span>
<span data-src="extralarge.jpg" data-media="(min-width: 1000px)"></span>
<span data-src="extralarge_x2.jpg" data-media="(min-width: 1000px) and (min-device-pixel-ratio: 2.0)"></span>
function lfbwc_get_author_links($post_id) {
if (!class_exists('WC_Product')) {
return array();
}
$product = get_product($post_id);
$attrs = $product->get_attributes();
$values = array();
if (!empty($attrs['pa_product-author'])) {
$author_terms = $attrs['pa_product-author'];
$author_terms = wp_get_post_terms($product->id, $author_terms['name']);
@tjtate
tjtate / gist:31626d69755f350ec649
Last active August 29, 2015 14:00
Google Universal Analytics Primary and Secondary Tracking Code
//
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
/**
The afga class is used to handle all custom google analytics tracking across all web properties
<?php
$totalRight = 10;
$passThreshold = 16;
if ($totalRight >= $passThreshold) { ?>
<script>
window.location = "http://gizoogle.com";
</script>
<?php
public function content() {
global $af_theme, $post;
$subscribed = $af_theme->has_access( $this->pubcode );
$new_label = ( $af_theme->is_new( get_the_date() ) ) ? '<span class="new">New</span>' : '';
$this->pub = $pub = new WP_Query( array( 'post_type' => 'af_product', 'posts_per_page' => 1, 'meta_key' => 'pubcode', 'meta_value' => $this->pubcode ) );
if( $pub->have_posts() ) :
while( $pub->have_posts() ) : $pub->the_post();
// Stash for later
<?php
global $wpdb;
//get all articles
$articlecount = $wpdb->get_results( 'SELECT COUNT(ID) AS total_posts FROM wp_posts WHERE post_status = "publish"' );
$articlecount = $articlecount[0]->total_posts;
$sql_limit = 200;