This file contains hidden or 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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
This file contains hidden or 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: Coming Soon | |
Description: Dumb coming soon plugin, deactivate to remove, activate to add. | |
Version: 2017-07-13 | |
Author: D4 Adv. Media | |
*/ | |
function quickmaintenance_page() { |
This file contains hidden or 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 show_post_of_the_day( $query ) { | |
if ( $query->is_home() && ! is_admin() && $query->is_main_query() ) { | |
$today = getdate(); | |
$args = array( | |
'post_type' => 'post', | |
'date_query' => array( |
This file contains hidden or 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 | |
echo $next_start; | |
$prev_post = get_adjacent_post( false, '', true ); | |
#print_r($prev_post); | |
if ( is_a( $prev_post, 'WP_Post' ) ) { | |
previous_post_link( '%link', __('Previous' , 'skivvy') ); | |
} else { | |
$first = new WP_Query('posts_per_page=1&order=DESC&post_type=saints'); | |
$first->the_post(); |
This file contains hidden or 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 | |
// Code to add to page tempate to prevent oembed - remove_filter( 'the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 ); | |
function shortcode_videochunk( $atts, $content = null ) { | |
$rand = explode(PHP_EOL, $content); | |
$rand = array_map('trim', $rand); | |
$rand = array_filter($rand, function($var){return ! empty($var);} ); | |
shuffle( $rand ); |
This file contains hidden or 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 shortcode_example ( $atts ) { | |
$attr = shortcode_atts(array( | |
'defaults' => NULL | |
), $atts); | |
if ( isset($attr['defaults']) ) { |
This file contains hidden or 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 client_info( $key = NULL ) { | |
$values = array( | |
'phone' => '1.555.5555', | |
'fax' => '1.555.5555', | |
'email' => '[email protected]', | |
'social' => array ( |
This file contains hidden or 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: D4 Functions | |
Description: Styles and functionality added by D4 | |
Version: 2017-03-06 | |
Author: D4 Adv. Media | |
*/ | |
# include('config.php'); | |
# include('lib/somefile.php'); | |
This file contains hidden or 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 shortcode_masthead( $atts, $content ) { | |
wp_enqueue_script('jcycle2'); | |
$output .= '<div class="masthead-chunk">'; | |
$output .= '<div '; | |
$output .= ' class="cycle-slideshow"'; // Initializing class, default for cycle2 | |
# $output .= ' data-cycle-pager="#per-slide-template"'. // Connects to #per-slide-template box below | |
$output .= ' data-cycle-slides=".cycle-slide"'; // identifies the class identifier for slides |
NewerOlder