Skip to content

Instantly share code, notes, and snippets.

View kylelarkin's full-sized avatar

Kyle Larkin kylelarkin

View GitHub Profile
@kylelarkin
kylelarkin / AJAX include for WordPress
Last active December 15, 2015 16:29
AJAX include for WordPress
<?php
define('WP_USE_THEMES', false);
require_once('../../../../wp-load.php');
?>
<?php $term = $_POST['term']; ?>
<?php $the_query = new WP_Query(array('feature-types'=>$term)); ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?><!-- start loop -->
<article>
<h1><?php the_title(); ?></h1>
<?php the_advanced_excerpt(); ?>
@kylelarkin
kylelarkin / Apache Ownership
Last active January 3, 2016 01:49
Changing uploads folder ownership to apache:apache Note: from within the wp-content directory
chown -R apache:apache uploads/
@kylelarkin
kylelarkin / SassMeister-input-HTML.html
Created January 30, 2014 06:36
Generated by SassMeister.com.
<div class="wrapper">
<header>
<h1>Header!</h1>
</header>
<aside>
<p>Organic white strong doppio froth white redeye sugar medium single shot cultivar to go. Cup wings, decaffeinated robusta at saucer strong. Et, viennese strong aromatic a qui wings turkish single origin. Iced seasonal, grinder cultivar viennese steamed decaffeinated latte. Redeye so sugar bar cappuccino, cup acerbic, caramelization wings caffeine and espresso.</p>
<p>Saucer so, cortado flavour whipped aromatic variety aromatic. Con panna doppio blue mountain at plunger pot macchiato cup ristretto filter. Froth cream robust, viennese cappuccino mocha, whipped macchiato blue mountain beans froth. Mug rich doppio sit ristretto variety americano kopi-luwak. Aromatic half and half robust percolator roast caffeine con panna.</p>
</aside>
<section class="main">
<ul class="pictures">
@kylelarkin
kylelarkin / gist:88175fcd92e32e8209f6
Created September 16, 2014 07:00
Update ACF Field Name in Database
UPDATE `wp_postmeta` SET `meta_key` = 'NEW NAME' WHERE `meta_key` = 'OLD NAME'
@kylelarkin
kylelarkin / gist:52d704a7688e32275945
Created April 28, 2015 19:34
Custom WordPress Query
<?php
// Setup the Arguments for the Custom Query
$args = array(
'post_type' => ''
);
// Create the Custom Query and save it as a variable
$the_query = new WP_Query( $args );
// Loop through our Custom Query results
if ( $the_query->have_posts() ) :