Skip to content

Instantly share code, notes, and snippets.

View BenSibley's full-sized avatar

Ben Sibley BenSibley

View GitHub Profile
@BenSibley
BenSibley / Envato
Last active December 24, 2015 14:29
Support templates from the post, "How to Make Your Customers Better at Customer Support." Please follow the guide here for instructions on how to best implement the templates: http://www.supportdash.com/customers-better-customer-support
<h3>How to Get Better, Faster Support</h3>
<p>Please follow these eight steps when you ask a question.  It helps us provide you with better support.</p>
<p>The Steps:</p>
<ol>
<li><a href="#sd-search">Search First</a></li>
<li><a href="#sd-ask">Ask the Right Person</a></li>
<li><a href="#sd-tell">Tell Us What is Wrong</a></li>
<li><a href="#sd-state">State Your Original Goal</a></li>
<li><a href="#sd-list">List the Symptoms</a></li>
/**
* Class for adding a new field to the options-general.php page
*/
class ct_drop_add_profile_image_upload {
/**
* Class constructor
*/
public function __construct() {
add_filter( 'admin_init' , array( &$this , 'register_fields' ) );
@BenSibley
BenSibley / gist:4df39279908797aa5ada
Created February 18, 2015 21:31
Pre word-break & padding
pre {
word-wrap: break-word;
-ms-word-wrap: break-word;
padding: 0 60px;
}
@BenSibley
BenSibley / gist:0ab1e1b2a500b150f26e
Created March 9, 2015 16:30
Tracks - Hide Site Title in Footer
.site-footer h3 {
display: none;
}
@BenSibley
BenSibley / ignite-plus-body-class.php
Last active August 29, 2015 14:26
Changing Ignite Plus Layouts
function my_add_body_classes( $classes ) {
if( is_page('116') ) {
$classes[] = 'two-column';
$classes[] = 'two-column-right';
}
return $classes;
}
add_filter( 'body_class', 'my_add_body_classes' );
@BenSibley
BenSibley / double-touch-menu.js
Created February 2, 2016 15:24
Double-touch mobile menu items
// wait to see if a touch event is fired
var hasTouch;
window.addEventListener('touchstart', setHasTouch, false);
// require a double-click on parent dropdown items
function setHasTouch () {
// since touch events are definitely being used, turn on the functionality
hasTouch = true;
@BenSibley
BenSibley / html5placeholders.php
Last active August 9, 2018 15:40
How to Add HTML5 Placeholders to the WordPress Comment Form
function my_update_comment_fields( $fields ) {
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$label = $req ? '*' : ' ' . __( '(optional)', 'text-domain' );
$aria_req = $req ? "aria-required='true'" : '';
$fields['author'] =
'<p class="comment-form-author">
<label for="author">' . __( "Name", "text-domain" ) . $label . '</label>
@BenSibley
BenSibley / placeholdercommentform.php
Created November 28, 2016 20:27
Add Placeholder to Comment Form
function my_update_comment_field( $comment_field ) {
$comment_field =
'<p class="comment-form-comment">
<label for="comment">' . __( "Comment", "text-domain" ) . '</label>
<textarea required id="comment" name="comment" placeholder="' . esc_attr__( "Enter comment here...", "text-domain" ) . '" cols="45" rows="8" aria-required="true"></textarea>
</p>';
return $comment_field;
}
@BenSibley
BenSibley / socialarray.php
Created November 30, 2016 13:36
Social media icons array
function ct_tribes_social_array() {
$social_sites = array(
'twitter' => 'tribes_twitter_profile',
'facebook' => 'tribes_facebook_profile',
'google-plus' => 'tribes_googleplus_profile',
'pinterest' => 'tribes_pinterest_profile',
'linkedin' => 'tribes_linkedin_profile',
'youtube' => 'tribes_youtube_profile',
'vimeo' => 'tribes_vimeo_profile',
@BenSibley
BenSibley / socialcustomizersection.php
Last active November 30, 2016 13:43
Adding a section with control to the Customizer
function my_add_customizer_sections( $wp_customize ) {
$social_sites = ct_tribes_social_array();
// set a priority used to order the social sites
$priority = 5;
// section
$wp_customize->add_section( 'ct_tribes_social_media_icons', array(
'title' => __( 'Social Media Icons', 'tribes' ),