Skip to content

Instantly share code, notes, and snippets.

View dauidus's full-sized avatar
🕶️
Sometimes wears pants. Always wears a smile.

Dave Winter dauidus

🕶️
Sometimes wears pants. Always wears a smile.
View GitHub Profile
@dauidus
dauidus / excerpt-character-counter.php
Created December 31, 2015 23:34 — forked from raewrites/excerpt-character-counter.php
Excerpt Character Counter
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("span#excerpt_counter").text(jQuery("#excerpt").val().length);
jQuery("#excerpt").keyup( function() {
if(jQuery(this).val().length > 500){
jQuery(this).val(jQuery(this).val().substr(0, 500));
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');
<?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.
# 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