Skip to content

Instantly share code, notes, and snippets.

View iamcanadian1973's full-sized avatar

Kyle Rumble iamcanadian1973

View GitHub Profile
@iamcanadian1973
iamcanadian1973 / facetwp.php
Created September 15, 2014 03:03
Wrap content for FacetWP
add_action('genesis_before_loop', 'kr_facetwp_start');
function kr_facetwp_start() {
echo '<div class="facetwp-template">';
}
add_action('genesis_after_loop', 'kr_facetwp_end');
function kr_facetwp_end() {
echo '</div><!-- close facetwp-->';
}
@iamcanadian1973
iamcanadian1973 / gist:0d6a2ab2ad16a1bca39f
Created November 30, 2014 08:11
Simple Social Icons remove inline styles
function remove_widget_action() {
global $wp_widget_factory;
remove_action( 'wp_head', array($wp_widget_factory->widgets['Simple_Social_Icons_Widget'], 'css') );
}
add_action('wp_head', 'remove_widget_action', 1);
@iamcanadian1973
iamcanadian1973 / be-subpages.php
Last active August 29, 2015 14:18
Add current parent class to Bill Erickson's Sub Page Widget
<?php
//* Add current parent class to Bill Erickson's Sub Page Widget
add_filter('be_subpages_widget_class', 'be_add_class', 10, 2);
function be_add_class( $class, $subpage ) {
global $post;
@iamcanadian1973
iamcanadian1973 / wp_remote_image_resize.php
Last active August 29, 2015 14:25
WordPress remote image resize
<?php
/**
* WordPress - Resize and save remote images
*
* @author Kyle Rumble
*
* @param string $image
* @param string $new_name
* @param int $width
@iamcanadian1973
iamcanadian1973 / jquery.scrollTo.and.highlight.anchor.js
Last active August 29, 2015 14:26 — forked from oneblackcrayon/jquery.scrollTo.and.highlight.anchor.js
When you want to highlight a navigation anchor with scrollTo
$(document).ready(function() {
$('nav.primary a').click(function(event) { // the elements you click to scroll
event.preventDefault();
var link = this; // you need this if you are using hash links on ex: a href="#link" to id="link"
$.smoothScroll({
offset: -160, // adjusts where the scroll will stop so the height of the scrolling element plus the height of the element you are scrolling to.
speed: 2000,
scrollTarget: link.hash
});
});
@iamcanadian1973
iamcanadian1973 / genesis-post-titles.php
Last active August 29, 2015 14:26 — forked from nairnwebdesign/genesis-post-titles.php
Changing Genesis H1 Post Titles to H2
/*
Changing Genesis H1 Post Titles to H2
*/
add_filter( 'genesis_post_title_output', 'ac_post_title_output', 15 );
function ac_post_title_output( $title )
{ if ( is_home() || is_archive() )
$title = sprintf( '<h1 class="entry-title"><a href="' . get_permalink() . '">%s</a></h1>', apply_filters( 'genesis_post_title_text',get_the_title() ) );
return $title;
@iamcanadian1973
iamcanadian1973 / ajax-search-pro.js
Created September 14, 2016 00:02
Ajax Search Pro - ASP Results Show Callback
// CANNOT GET THIS TO WORK
$(".asp_main_container").on("asp_results_show", function(event, id, instance) {
// Console does not log anyhting
console.log(id, instance, phrase);
});
@iamcanadian1973
iamcanadian1973 / single-photo-foobox-gallery.php
Last active September 29, 2016 16:33
Create a FooBox gallery that launches form a single button
@iamcanadian1973
iamcanadian1973 / functions.php
Created June 26, 2017 19:31
Add CSS to admin
<?php
add_action('admin_head', 'my_custom_styles');
function my_custom_styles() {
echo '<style>
.class-name {
padding: 100px;
}
</style>';
@iamcanadian1973
iamcanadian1973 / functions.php
Created June 26, 2017 19:36
Add CSS script to WP admin
<?php
add_action( 'admin_enqueue_scripts', 'load_admin_scripts' );
function load_admin_scripts() {
wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/css/subscriber.css', false, '1.0' );
}