Skip to content

Instantly share code, notes, and snippets.

View jeremycaris's full-sized avatar

Jeremy Caris jeremycaris

View GitHub Profile
@gregrickaby
gregrickaby / functions.php
Created June 7, 2012 13:48
Allow HTML in WordPress Custom Menu Descriptions
/**
* Create HTML list of nav menu items and allow HTML tags.
* Replacement for the native menu Walker, echoing the description.
* This is the ONLY known way to display the Description field.
*
* @see http://wordpress.stackexchange.com/questions/51609/
*
*/
class Description_Walker extends Walker_Nav_Menu {
@Abban
Abban / WordPress Theme Customizer Sample.php
Created June 21, 2012 21:09
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
<?php
add_filter( 'gform_ajax_spinner_url', 'tgm_io_custom_gforms_spinner' );
/**
* Changes the default Gravity Forms AJAX spinner.
*
* @since 1.0.0
*
* @param string $src The default spinner URL.
* @return string $src The new spinner URL.
*/
@mchrislay
mchrislay / select-text-woo-checkoutt.php
Created January 24, 2013 02:05
Add Select Radio Buttons + Text Field option to WooCommerce Checkout Page
<?php
/**
* Outputs a rasio button form field
*/
function woocommerce_form_field_radio( $key, $args, $value = '' ) {
global $woocommerce;
$defaults = array(
'type' => 'radio',
'label' => '',
@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@j0lvera
j0lvera / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",
@katienelson
katienelson / slide-up-fade-in.html
Last active September 24, 2019 18:05
Slide Up Fade In - Keyframe animation and CSS class. Apply .slide-up-fade-in to element you wish to apply the effect. Demo on http://codepen.io/katienelson/pen/KwXEzN
<div class="outer-square">
<div class="square slide-up-fade-in">
<h3 class="slide-up-fade-in">Title</h3>
<p class="slide-up-fade-in">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p class="slide-up-fade-in">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="clearfix"></div>
</div>
@yratof
yratof / functions.php
Created March 25, 2015 16:43
Advanced Custom Fields - Update Gallery with Gravity Forms
$gravity_form_id = 6; // gravity form id, or replace {$gravity_form_id} below with this number
add_filter("gform_after_submission_{$gravity_form_id}", 'jdn_set_post_acf_gallery_field', 10, 2);
function jdn_set_post_acf_gallery_field($entry, $form)
{
$gf_images_field_id = 42; // the upload field id
$acf_field_id = 'field_54804833b3067'; // the acf gallery field id
// get post
@JenniferMack
JenniferMack / md-toc.rb
Last active July 18, 2024 12:00
Create a table of contents for Ulysses markdown
#!/usr/bin/env ruby
toc = "# Table of Contents\n"
newmd = ""
ARGF.each_line do |line|
newmd << line
next if !line.start_with?("#")
heading = line.gsub("#", "").strip
@joe-dempsey
joe-dempsey / shopify-sub.liquid
Last active March 19, 2024 21:51
Shopify menu with submenu
{% comment %} this is a barebones menu with submenu items for Shopify {% endcomment %}
{% comment %} see shopify docu for creating submenu items: https://help.shopify.com/manual/sell-online/online-store/menus-and-links#create-a-drop-down-menu {% endcomment %}
{% comment %} first assign the menu - this is the only thing you need to change {% endcomment %}
{% assign linklist = settings.collections_nav %}
{% comment %} in the above line change the collections_nav to the handle of your main naivgation {% endcomment %}
{% comment %} the code below will do the rest {% endcomment %}