Skip to content

Instantly share code, notes, and snippets.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 12, 2025 14:05
A badass list of frontend development resources I collected over time.
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active May 28, 2025 00:16
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@pospi
pospi / font-list-bullets.css
Created September 24, 2013 01:18
List bullets using font characters (best used with icon fonts!). Supported in everything except IE6 & 7, with graceful fallback.
ul {
list-style:none;
padding: 0 0 0 2em; /* padding includes space for character and its margin */
/* IE7 and lower use default */
*list-style: disc;
*padding: 0 0 0 1em;
}
ul li:before {
content: '\25BA';
@aderaaij
aderaaij / acf-future-posts.php
Last active February 8, 2024 14:29
Advanced Custom Fields datepicker: Show only events with a date of today or in the future. Extra comments from Pasnon @ ACF Forums: f you needed to, you could also play with the comparison date, which is the first array in meta_query, currently set to date("Y-m-d") which is today; if you were to make it date("Y-m-d", strtotime("-1 day")) you cou…
<?php
/*
* Display posts only from today and in the future:
* http://old.support.advancedcustomfields.com/discussion/6000/how-to-sort-posts-by-acf-date-and-display-only-future-posts
* by Pasnon
*/
$date_args = array(
'post_type' => 'events',
@rosswintle
rosswintle / gist:6899635
Created October 9, 2013 11:12
Code to do a WordPress query for posts that start with a given letter. Assumes a letter has been passed in the URL as "?s=a" where a is the letter. This code is part of some code that handles ajax requests. You'll need to write mytheme_ajax_list() to run a proper query and/or return results somehow.
// AJAX function for listing directory entries alphabetically
add_action('wp_ajax_directory_alpha', 'mytheme_ajax_directory_alpha');
add_action('wp_ajax_nopriv_directory_alpha', 'mytheme_ajax_directory_alpha');
function mytheme_ajax_directory_alpha() {
function alpha_post_where( $where ) {
$new_where = $where . " AND lower(substring(post_title, 1, 1)) = lower('" . $_REQUEST['s'] . "')";
return $new_where;
}
@joyrexus
joyrexus / README.md
Last active May 16, 2025 01:54 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@ijy
ijy / sublime-text-3-setup.md
Last active March 7, 2025 20:44
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following:
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active June 16, 2025 08:57
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@brycejacobson
brycejacobson / page_template.php
Created December 4, 2013 21:17
Get custom field date in WP_Query and show the post if the date is in the future. Using Advance Custom Fields.
<?php
$today = date('Ymd', strtotime('-1 day'));
// WP_Query arguments
$args = array (
'post_type' => 'construction_bids',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'bid_deadline',
'value' => $today,
@pospi
pospi / wordpress-hostchange.sql
Created January 30, 2014 23:04
Some SQL for quickly moving WordPress sites between servers.
SET @FROMDOMAIN = 'myolddomain.com';
SET @TODOMAIN = 'mynewdomain.com';
SET @FROMSCHEME = 'http';
SET @TOSCHEME = 'http';
#-------------- STANDARD TABLES -------------#
UPDATE wp_options