Skip to content

Instantly share code, notes, and snippets.

View rickalee's full-sized avatar

Ricky Lee Whittemore rickalee

View GitHub Profile
@rickalee
rickalee / functions.php
Last active October 24, 2024 18:22
block_editor_settings_all
<?php
/**
* Enable Automatic Anchor Tags Generation for Headings
*/
function enable_block_anchors( $settings, $context ) {
// Enable anchor generation
$settings['generateAnchors'] = true;
return $settings;
}
$alt_text = get_post_meta( $slide['slide_background_file_id'], '_wp_attachment_image_alt', true );
@rickalee
rickalee / clicktale.html
Created May 14, 2018 20:37
MSCC Clicktale
<script>
function clicktaleTracking() {
var s = document.createElement( 'script' );
var src = "https://cdnssl.clicktale.net/www07/ptc/959721af-e707-44b6-9b6a-d14f3ec0f756.js";
s.setAttribute( 'src', src );
document.body.appendChild( s );
}
</script>
<script>
@rickalee
rickalee / youtube_embed_no_cookie.php
Created March 27, 2018 02:55
Youtube No Cookie Domain
@rickalee
rickalee / add_user_twitter.php
Last active March 26, 2018 14:31
Add Twitter handle/username to User Contact Information
<?php
/**
* Add Twitter handle/username to User Contact Information
*
* @param $user_contact
*
* @return array
*/
function user_contact_add_twitter( $user_contact ) {
$user_contact['twitter'] = __( 'Twitter Username' );
@rickalee
rickalee / gist:13e570cb45174d1f68ed
Created December 3, 2015 15:54
Shortcake UI Alignment
shortcode_ui_register_for_shortcode(
'wfcf_deal',
array(
'label' => 'Deal',
'listItemImage' => 'dashicons-awards',
'attrs' => array(
array(
'label' => 'Select Deal',
'attr' => 'deal',
'type' => 'post_select',
@rickalee
rickalee / gist:5eb1565c4d867345e335
Last active August 29, 2015 14:06
Breakpoint Mixin, Clearfix and Wrap
@mixin breakpoint($point) {
@if $point == lt-phablet {
@media all and (max-width: 599px) { @content; }
}
@if $point == phablet {
@media all and (min-width: 600px) { @content; }
}
@if $point == lt-tablet {
@media all and (max-width: 767px) { @content; }
}

IDX Shortcode Documentation

idx_form

Description: Used to display a form

Allowed Attributes:

  • id -- The id of the form to be displayed.
  • action -- Sets the 'action' HTML attribute on the form (i.e. where it submits to)
@rickalee
rickalee / gist:6e4e2927adfd66c7ca0b
Created June 6, 2014 17:41
Filter Widget Title to add span on first word
add_filter ( 'widget_title', 'kellyboudreau_add_span_widgets' );
function kellyboudreau_add_span_widgets( $old_title ) {
$title = explode( " ", $old_title, 2 );
if ( isset( $title[0] ) && isset( $title[1] ) ) {
$titleNew = "<span>$title[0]</span> $title[1]";
}
else {
return;
}
return $titleNew;
@rickalee
rickalee / gist:10475557
Created April 11, 2014 14:56
WordPress Share Buttons
<a class="share-on-link share-on-twitter" href="https://twitter.com/intent/tweet?text=<?php echo urlencode(the_title_attribute('echo=0')); ?>&url=<?php the_permalink();?>">Twitter</a>
<a class="share-on-link share-on-facebook" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>">Facebook</a>
<a class="share-on-link share-on-googleplus" href="https://plus.google.com/share?url=<?php the_permalink();?>">Google+</a>