Skip to content

Instantly share code, notes, and snippets.

View ranchodeluxemedia's full-sized avatar

Chris Canterbury ranchodeluxemedia

View GitHub Profile
@ranchodeluxemedia
ranchodeluxemedia / anywhere-elementor-date-function.php
Created March 10, 2019 21:22
Sort by today and future dates in Anywhere Elementor widget
// ACF Date Listing Function for AnywhereElementor
function event_listing_filter_function($date_args){
$date_args = array(
'post_type' => 'event',
'meta_key' => 'event_date',
'posts_per_page' => -1,
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query'=> array(
array(
$args = array(
'post_type' => array( 'news', 'events' ),
'meta_key' => 'end-date',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'end-date',
'value' => date ( 'Ymd' ),
'type' => 'NUMERIC',
wp post create --post_type=page --post_status=publish --post_title='Contact' && wp post create --post_type=page --post_status=publish --post_title='Home' && wp post create --post_type=page --post_status=publish --post_title='Another Page'
function jquery_parallax() {
?>
<script language="JavaScript" type="text/javascript">
;(function($) {
'use strict'
<?php
$queryName = new WP_Query(
array(
'post_type'=>'POST_TYPE_NAME',
'posts_per_page'=>'-1',
'order'=>'ASC',
'orderby' => 'menu_order',
'post_status' => 'publish'
));
?>
@ranchodeluxemedia
ranchodeluxemedia / domain_agnostic_wordpress.php
Created March 14, 2017 03:55
Domain agnostic wordpress setup
<?php
define('WP_HOME', "http://{$_SERVER['HTTP_HOST']}/");
define('WP_SITEURL', "http://{$_SERVER['HTTP_HOST']}/");
<?php
/* Enqueue Wordpress Scripts and Styles
-------------------------------------------------- */
function wp_enqueue_scripts_styles() {
// Javascript - Register Scripts
wp_register_script( 'bootstrap-script', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.2', true ); // -- From Parent Theme
wp_register_script( 'documents-script', get_stylesheet_directory_uri() . '/bootstrap/docs/docs.min.js', array( 'bootstrap-script' ), '3.2', true ); // -- From Child Theme
wp_register_script( 'bootlint-script', 'http://maxcdn.bootstrapcdn.com/bootlint/0.3.0/bootlint.min.js', array( 'angularjs-bootstrap-script' ), '0.3.0', true ); // -- From an External URL
@ranchodeluxemedia
ranchodeluxemedia / acf-date-time-order-query.php
Created February 2, 2017 08:06 — forked from badcrocodile/acf-date-time-order-query.php
Ordering Events by Advanced Custom Fields Date & Time Picker Field
<?php
// Credit to http://joshuaiz.com/words/ordering-events-by-advanced-custom-fields-date-time-picker-field/
$time = current_time( 'timestamp' ); // Get current unix timestamp
// Set up custom query with meta_query to compare event start date with today's date
$args = array (
'post_type' => 'event', // your event post type slug
'post_status' => 'publish', // only show published events
'orderby' => 'meta_value', // order by date
# Virtual Host File
# Common wordpress configurations included in /etc/nginx/wordpress.conf
# All virtual hosts including this one are symlinked to /etc/nginx/sites-enabled
# Make sure you replace "mysite" with your domain name
server {
listen 80 default_server;
listen 443 ssl;
server_name mysite.com;
@ranchodeluxemedia
ranchodeluxemedia / wordpress.conf
Created September 16, 2016 20:49
PHP 7 Wordpress.conf for Nginx
##################################
# WORDPRESS NGINX CONFIGURATIONS
##################################
# /etc/nginx/wordpress.conf
#
# Contains a common configuration for use by nginx on a WordPress
# installation. This file should be included in any WordPress site
# nginx virtual host config located in sites-available with the following line:
#
# include /etc/nginx/wordpress.config;