Skip to content

Instantly share code, notes, and snippets.

@TheHeat
TheHeat / .wpe-push-ignore
Created February 14, 2024 12:37
Prevent Local from pushing core or dev files to WP Engine
# This file lists which files should not be pushed by WPE DevKit. Feel free to
# add, remove, or comment lines to change the sync behavior, but note that this
# file will be recreated with the default values if it is missing. There are a
# few additional files, including wp-config.php, which are ignored no matter
# what as synchronizing these files would almost certainly result in an unusable
# install.
# Temporary and OS files
*~
.DS_Store
@TheHeat
TheHeat / unquarantine a file in MacOS
Created May 8, 2023 21:41
Enable MacOS to run a file from an unknown dev. I use this for enabling VSTs. With thanks to OSIRIS GUITAR https://www.youtube.com/watch?v=WJ6c6-nB6SQ
sudo xattr -rd com.apple.quarantine {file path}
@TheHeat
TheHeat / proper-make-excerpt.php
Created June 9, 2016 12:24
Convert text to usable excerpts outside the loop
<?php
// Cleans up and shortens text
// for creating excerpt when custom excerpts aren't available
// Wrapper around wp_trim_words with added shortcode removal
function proper_make_excerpt($content, $count = 50, $more = '&hellip;'){
// remove shortcodes first so we don't include them in our count
$content = strip_shortcodes( $content );
@TheHeat
TheHeat / exclude-untranslated.php
Last active February 26, 2016 19:39
Using qtranslate-x exclude untranslated posts from blog feed and cat archives
// lets us know if the current post is available in the current locale
function proper_is_translated($id = 0){
global $post;
if($id == 0){
$context = $post->ID;
}else{
$context = $id;
}
@TheHeat
TheHeat / jq-document-ready.js
Created May 23, 2015 13:37
jQuery_documentready
$(document).ready(function(){
// GO!
});
@TheHeat
TheHeat / echo-array.php
Created May 22, 2015 19:55
php_echo-array
echo '<pre>';
echo $array;
echo '</pre>';
@TheHeat
TheHeat / wp-admin-bump.scss
Created November 17, 2014 22:58
Mixin to include with any fixed position styles to adjust for the WordPress admin bar.
// Use wherever a fixed position is declared to adjust for that pesky WP admin bar.
@mixin wp-admin-bump{
.admin-bar & {
margin-top: 46px;
@media screen and (min-width: 782px){
margin-top: 32px;
}
}
}
@TheHeat
TheHeat / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@TheHeat
TheHeat / taxterm-title.php
Created February 11, 2014 15:21
WP taxonomy term archive title
if (is_tax() ) :
$single_tax_term = get_queried_object();
echo $single_tax_term->name;
endif;
@TheHeat
TheHeat / upcoming-events.php
Last active December 18, 2015 02:19 — forked from stephenharris/upcoming-events.php
Display a list of upcoming events with Event Organiser http://wp-event-organiser.com/ without repeating instances of recurring events.
/**
* Display a list of upcoming events with Event Organiser without repeating instances of recurring events
**/
//Get upcoming events for the next 6 months
$events = eo_get_events(array(
'event_start_after'=>'today',
'event_end_after' =>'today',
'event_start_before' => '+6 month',