Skip to content

Instantly share code, notes, and snippets.

View slushman's full-sized avatar

Chris Wilcoxson slushman

View GitHub Profile
@slushman
slushman / Parker Results Cheatsheet.md
Last active October 20, 2016 14:54
Cheatsheet for the results from Parker.
  • Total Stylesheets
    • The quantity of stylesheets it examined.
  • Total Stylesheet Size
    • Size in bytes of the stylesheet(s)
    • Ideal: no real ideal, but smaller is better.
  • Total Rules
    • The quantity of CSS rules in the stylesheet(s).
    • Ideal: no real ideal, but a smaller number here means a simpler stylesheet.
  • Total Selectors
    • The quantity of selectors in the stylesheet(s).
@slushman
slushman / formidable-forms-select.php
Created July 18, 2016 18:14
WordPress Customizer select control with published Formidable forms.
$forms = FrmForm::get_published_forms();
$choices = array();
foreach ( $forms as $form ) {
$choices[$form->id] = $form->name;
}
// Formidable Forms Select Field
@slushman
slushman / customizer-links.php
Last active September 23, 2023 13:03
How to link into the WordPress Customizer
@slushman
slushman / themes-security-config.md
Created May 2, 2016 15:31
iThemes Security Configuration

Table of Contents

  • Settings
    • [Global] (#global)
    • [404 Detection] (#404)
    • [Away Mode] (#away)
    • [Banned Users] (#banned)
    • [Brute Force Protection] (#brute)
    • [Backup DB] (#backupdb)
    • [File Change Detection] (#files)
  • [Hide Login] (#hidelogin)
@slushman
slushman / htaccess.txt
Last active January 16, 2024 12:49
htaccess for WordPress sites on SiteGround
# # WEB PERFORMANCE
# Remove `ETags` as resources are sent with far-future expires headers.
# `FileETag None` doesn't work in all cases.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
$homeposts = yourtheme_get_posts( 'post', array( 'category_name' => 'name_of_the_category', 'posts_per_page' => 1 ), 'homepage' );
foreach ( $homeposts->posts as $homepost ) {
// process each post here
}
/**
* Returns a post object of the requested post type
@slushman
slushman / Sublime Text Packages
Created January 13, 2016 05:03
List of Package for Sublime Text 3
Package Control - https://packagecontrol.io/installation
Tomorrow Color Schemes
@slushman
slushman / Sublime Text 3 User Preferences
Created January 13, 2016 04:48
My Sublime Text 3 User Preferences
{
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
@slushman
slushman / gist:454cc8b26c330727df13
Last active December 28, 2015 08:49
Customize the Featured Image labels
/**
* Changes strings referencing Featured Images for a post type
*
* In this example, the post type in the filter name is "employee"
* and the new reference in the labels is "headshot".
*
* @see https://developer.wordpress.org/reference/hooks/post_type_labels_post_type/
*
* @param object $labels Current post type labels
* @return object Modified post type labels
@slushman
slushman / open-current-submenu-toggle-on-hover.js
Last active September 8, 2015 16:11
Open Current SubMenu; Toggle on Hover
/**
* WordPress menu
*
* Opens the current page's submenu. When hovering over another top-level
* menu item, it closes the open submenu and opens the other.
*
* Only operates if the current menu item is defined, so it won't do
* anything on pages that don't have a submenu or don't have a
* current menu item (ie. if you don't have a "Home" menu item and submenu,
* it won't do anything on the home page).