Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View icreatesolutions's full-sized avatar

icreatesolutions

View GitHub Profile
<?php
add_filter( 'genesis_single_crumb', 'icreate_blog_breadcrumb_filter', 10, 2 );
function icreate_blog_breadcrumb_filter( $crumbs, $args ) {
$crumbs = '<span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem"><a href="'
. get_the_permalink( get_option( 'page_for_posts' ) )
.'" itemprop="item"><span itemprop="name">'
. get_the_title( get_option( 'page_for_posts' ) ) . '</span></a></span> ' . $args['sep'] .' ' . get_the_title();
return $crumbs;
}
@icreatesolutions
icreatesolutions / 0_reuse_code.js
Created November 23, 2015 23:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
jQuery(document).on('gform_post_render', function(){
jQuery.fancybox.update();
});
@icreatesolutions
icreatesolutions / soliloquy_in_post.php
Created December 8, 2015 22:46
Functions for associating a soliloquy slider with a post
<?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
@icreatesolutions
icreatesolutions / tinymce-custom-formats.php
Created January 12, 2016 02:30
TinyMCE Custom Formats in WordPRess
<?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 / genesis-custom-sidebar.php
Created January 13, 2016 23:27
Genesis Custom Sidebar
<?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 / gravity_button_submit.php
Created February 2, 2016 02:42
Gravity Forms Button for Submit
<?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;
}
@icreatesolutions
icreatesolutions / wp-social-menu.less
Created February 4, 2016 23:38
Wordpress Social Menu
// 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 / aggregate-reviews-schema.php
Created September 29, 2016 04:16
Aggregate Reviews Schema Tags
<?php
function display_aggregate_rating() {
$num_ratings = 0;
$agg_score = 0;
$args = array(
'post_type' => 'testimonials',
'posts_per_page' => '-1'
);
$testimonials = get_posts( $args );
@icreatesolutions
icreatesolutions / icreate-simple-endpoint.php
Created September 19, 2018 05:08
Simple Endpoint Plugin
<?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' ) ) {