Skip to content

Instantly share code, notes, and snippets.

icreatesolutions

Block or report user

Report or block icreatesolutions

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@icreatesolutions
icreatesolutions / gform-label.js
Last active Oct 24, 2018
Gravity Form - Label Minimising
View gform-label.js
// Target Gravity Form Inputs
var inputs = '.ginput_container input';
emFieldFocus(inputs);
// Failed Submission
$(document).on('gform_post_render', function(){
$(inputs).each(function() {
if( $(this).val() ) {
$(this).parents('.ginput_container').siblings('.gfield_label').addClass('filling');
View icreate-simple-endpoint.php
<?php
/*
Plugin Name: iCreate Simple Endpoint
Description: Simple way to add a landing page endpoint
Author: iCreate Advertising
Version: 1.0.0
Author URI: https://icreateadvertising.com.au
*/
if ( ! defined( 'ABSPATH' ) ) {
View aggregate-reviews-schema.php
<?php
function display_aggregate_rating() {
$num_ratings = 0;
$agg_score = 0;
$args = array(
'post_type' => 'testimonials',
'posts_per_page' => '-1'
);
$testimonials = get_posts( $args );
View wp-social-menu.less
// Inspiration:
// https://kovshenin.com/2014/social-menus-in-wordpress-themes/
#menu-social-menu{
width: auto;
test-align: center;
display: inline-block;
margin-top: 5px;
li {
float: left;
@icreatesolutions
icreatesolutions / gravity_button_submit.php
Created Feb 2, 2016
Gravity Forms Button for Submit
View gravity_button_submit.php
<?php
add_filter( 'gform_submit_button', 'form_submit_button', 10, 5 );
function form_submit_button ( $button, $form ){
$button = str_replace( "input", "button", $button );
$button = str_replace( "/", "", $button );
$button .= "{$form['button']['text']}</button>";
return $button;
}
View genesis-custom-sidebar.php
<?php
add_action('get_header','icreate_change_genesis_sidebar');
function icreate_change_genesis_sidebar() {
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); //remove the default genesis sidebar
add_action( 'genesis_sidebar', 'icreate_do_cpt_sidebar' ); //add an action hook to call the function for my custom sidebar
}
function icreate_do_cpt_sidebar() {
genesis_widget_area( 'search-sidebar' );
}
@icreatesolutions
icreatesolutions / tinymce-custom-formats.php
Created Jan 12, 2016
TinyMCE Custom Formats in WordPRess
View tinymce-custom-formats.php
<?php
add_filter( 'tiny_mce_before_init', 'icreate__custom_tinymce_formats' );
function icreate__custom_tinymce_formats( $init_array ) {
// Define the style_formats array
$style_formats = array(
array(
'title' => '.blockquote-alt',
'block' => 'blockquote',
'classes' => 'blockquote-alt',
'wrapper' => true,
@icreatesolutions
icreatesolutions / soliloquy_in_post.php
Created Dec 8, 2015
Functions for associating a soliloquy slider with a post
View soliloquy_in_post.php
<?php
// Display Soliloquy Slider metabox on custom post type
add_filter( 'soliloquy_skipped_posttypes', 'icreate_soliloquy_skipped_posttypes' );
function icreate_soliloquy_skipped_posttypes( $post_types ) {
unset( $post_types['custom_type_slug'] );
return $post_types;
}
// Set slider dimensions
View gravity_forms_fancybox_update.php
<?php
jQuery(document).on('gform_post_render', function(){
jQuery.fancybox.update();
});
@icreatesolutions
icreatesolutions / 0_reuse_code.js
Created Nov 23, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.