Instantly share code, notes, and snippets.

View functions.php
<?php
add_action( 'wp_enqueue_scripts', 'prefix_in_browser' );
/**
* Enqueuing Stick it with Waypoints
*/
function prefix_in_browser() {
wp_enqueue_script( 'waypoints-init', get_stylesheet_directory_uri() . '/js/waypoints.init.js', array( 'waypoints' ), '1.0.0', true );
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/jquery.waypoints.min.js', array( 'jquery' ), '4.0.1', true );
wp_enqueue_script( 'sticky', get_stylesheet_directory_uri() . '/js/sticky.min.js', array( 'waypoints' ), '1.0.0', true );
View waypoints-enqueue.php
<?php
add_action( 'wp_enqueue_scripts', 'prefix_in_browser' );
/**
* Enqueuing Waypoints & CSS Animate
*
*/
function prefix_in_browser() {
wp_enqueue_script( 'waypoints-init', get_stylesheet_directory_uri() . '/js/waypoints.init.js', array( 'waypoints' ), '1.0.0', true );
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/jquery.waypoints.min.js', array( 'jquery' ), '4.0.1', true );
View col-link.css
View image.php
<?php
// Create the variable for the large image src link
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
// Out the Post Title Using the post permalink for the post link - then the image which links to its large size
?>
<h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
View functions.php
<?php // <~ don't add me in
add_action( 'restrict_manage_posts', 'filter_backend_by_taxonomies' , 99, 2);
/* Filter CPT via Custom Taxonomy */
/* https://generatewp.com/filtering-posts-by-taxonomies-in-the-dashboard/ */
function filter_backend_by_taxonomies( $post_type, $which ) {
// Apply this to a specific CPT
if ( 'light' !== $post_type )
View functions.php
<?php // <~ don't add me in
add_shortcode( 'all_the_single_dates', 'all_the_single_dates' );
// Event Dates - display single date only for single dates & multi dates for multiple day events
function all_the_single_dates() {
// Get the start date and end date
// https://pastebin.com/ij0g9Tcf
// https://theeventscalendar.com/support/forums/topic/remove-end-date-if-same-as-start-date/#post-46651
ob_start();
View relationship-output.php
<?php //<~ don't add me
add_shortcode( 'tl_related_lights', 'tl_related_lights_relationship' );
// Add Relationship ACF field between Projects and Lights
function tl_related_lights_relationship() {
ob_start();
$posts = get_field('tl_project_lights_link_used');
if( $posts ): ?>
View slow-mysql-queries.log
This file has been truncated, but you can view the full file.
/usr/sbin/mysqld, Version: 5.7.21-0ubuntu0.16.04.1-log ((Ubuntu)). started with:
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock
Time Id Command Argument
# Time: 2018-04-11T23:22:58.672420Z
# User@Host: vultr_cgp[vultr_cgp] @ localhost [] Id: 234324
# Query_time: 0.152190 Lock_time: 0.031670 Rows_sent: 0 Rows_examined: 0
use vultr_cgp;
SET timestamp=1523488978;
SELECT option_value FROM wp_options WHERE option_name = '_transient_timeout_jetpack_idc_allowed' LIMIT 1;
View accordion-menu.js
// Category Accordion
// Example - http://dev.rose.websitelove.com.au/shop/
if ($('.wgs-side-woo ul.product-categories').length > 0) {
var lcP = $('.wgs-side-woo li.cat-parent'), lcPF = $('.wgs-side-woo li.cat-parent.cat-item-2204');
var lcPC = $('.wgs-side-woo li.current-cat'), lcPCP = $('.wgs-side-woo li.current-cat-parent');
lcP.prepend('<span class="toggle"><i class="fa fa-minus-square-o fa-plus-square-o"></i></span>');
lcP.parent('ul').addClass('has-toggle'); lcP.children('ul').hide();
if (lcP.hasClass("current-cat-parent")) {
lcPCP.addClass('open'); lcPCP.children('ul').show(); lcPCP.children().children('i.fa').removeClass('fa-plus-square-o');
} else if (lcP.hasClass("current-cat")) {
View html.html
<ul class="list-buttons">
<li class="active"> <a id="showall">Show All</a></li>
<li><a class="showSingle" target="1">Show Classes</a></li>
<li><a class="showSingle" target="2">Show Treatments</a></li>
</ul>
<!-- Rows -->
<div id="div1" class="primary-row">...</div>