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 | |
/** | |
WordPress loop | |
Taxonomy and Terms | |
*/ | |
$faq_object = get_sub_field('section_faq_category'); | |
if( $faq_object ): | |
foreach ( $faq_object as $faq_object_single ) { | |
$tax_id_convert = $faq_object_single->term_id; | |
$tax_id_all[] = $tax_id_convert; |
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
Get WordPress Permalink By Page Name | |
<a href="<?php echo get_permalink( get_page_by_path( 'Events' ) ); ?>"> | |
Events | |
</a> | |
Get WordPress Permalink By Page Slug | |
<a href="<?php echo get_permalink( get_page_by_path( 'events' ) ) ?>"> | |
Events | |
</a> | |
Get WordPress Permalink Parent/Child | |
If you have a page hierarchy you will have to pass the full slug including the parent to the get_page_by_path() 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
const { src, dest, series, parallel } = require('gulp'); | |
const plumber = require('gulp-plumber'); | |
const zip = require('gulp-zip'); | |
/*--- Extras ----------*/ | |
function ziptheme(cb) { | |
const timestamps = Date.now(); | |
console.log(timestamps) | |
return src(['./*/**/**', '!node_modules/**/**']) | |
.pipe(plumber()) |
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 | |
function add_gf_cap() | |
{ | |
$role = get_role( 'editor' ); | |
$role->add_cap( 'gform_full_access' ); | |
} | |
add_action( 'admin_init', 'add_gf_cap' ); |
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 | |
function change_link( $permalink, $post ) { | |
if( $post->post_type == 'resources_post_type' ) { | |
$resource_terms = get_the_terms( $post, 'resource_type' ); | |
$term_slug = ''; | |
if( ! empty( $resource_terms ) ) { | |
foreach ( $resource_terms as $term ) { |
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
.rngtAd, | |
.rockmelt-ad, | |
.rockmeltAdWrapper, | |
.rolloverad, | |
.rot_ads, | |
.rotating-ad, | |
.rotating-ads, | |
.rotatingAdvertisement, | |
.rotatingBannerWidget, | |
.rotatingadsection, |
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 | |
if(isset($_POST['login'])) { | |
if(!isset($_POST['g-recaptcha-response']) || empty($_POST['g-recaptcha-response'])) { | |
echo 'reCAPTHCA verification failed, please try again.'; | |
} else { | |
$secret = 'google_secret_key'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
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
// 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 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() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |