Skip to content

Instantly share code, notes, and snippets.

Probably teaching or writing code. Or, neither of those things.

Dave Winter dauidus

Probably teaching or writing code. Or, neither of those things.
View GitHub Profile
View excerpt-character-counter.php
function excerpt_count_js(){
if ('page' != get_post_type()) {
echo '<script>jQuery(document).ready(function(){
jQuery("#postexcerpt .handlediv").after("<div style=\"position:absolute;top:12px;right:34px;color:#666;\"><small>Excerpt length: </small><span id=\"excerpt_counter\"></span><span style=\"font-weight:bold; padding-left:7px;\">/ 500</span><small><span style=\"font-weight:bold; padding-left:7px;\">character(s).</span></small></div>");
jQuery("#excerpt").keyup( function() {
if(jQuery(this).val().length > 500){
jQuery(this).val(jQuery(this).val().substr(0, 500));
View Meta Slider - Layer Editor - Add fonts
function metaslider_add_custom_fonts_to_layer_editor($custom_fonts) {
return "Raleway/raleway; Kavoon/kavoon; Roboto/roboto";
add_filter('metaslider_layer_editor_fonts', 'metaslider_add_custom_fonts_to_layer_editor');
View save-the-children.php
* Debugging WordPress things.
* All of this belongs in your wp-config.php file.
* This will make sure that the code you release is, at a minimum,
* relatively free of PHP notices and warnings.
* - WP_DEBUG: This turns on debugging mode.
View .gitignore
# This is a template .gitignore file for git-managed WordPress projects.
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
# See the comments below for more info on how to add exceptions for your
You can’t perform that action at this time.