Skip to content

Instantly share code, notes, and snippets.

💻
Fixing things

Jeffrey Pearce jeffikus

💻
Fixing things
Block or report user

Report or block jeffikus

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
@jeffikus
jeffikus / woocommerce.php
Created Dec 1, 2017
WooCommerce Jetpack Infinite Scroll example Part 2
View woocommerce.php
<?php
/**
* Workaround to prevent is_shop() from failing due to WordPress core issue
*
* @link https://core.trac.wordpress.org/ticket/21790
* @param array $args infinite scroll args.
* @return array infinite scroll args.
*/
function _s_woocommerce_is_shop_page() {
global $wp_query;
@jeffikus
jeffikus / functions.php
Created Dec 1, 2017
WooCommerce Jetpack Infinite Scroll example Part 1
View functions.php
<?php
/**
* Custom render function for Infinite Scroll.
*/
function _s_infinite_scroll_render() {
if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) ) {
_s_woocommerce_product_columns_wrapper();
woocommerce_product_loop_start();
}
@jeffikus
jeffikus / functions.php
Created Dec 1, 2015
Modifies Projects post type to be Services
View functions.php
<?php
add_filter( 'projects_post_type_rewrite', 'change_projects_nomenclature_rewrite' );
add_filter( 'projects_post_type_labels', 'change_projects_nomenclature_labels' );
add_filter( 'projects_post_type_singular_name', 'change_projects_nomenclature_singular_name' );
add_filter( 'projects_post_type_plural_name', 'change_projects_nomenclature_plural_name' );
add_filter( 'projects_post_type_designation', 'change_projects_nomenclature_designation' );
function change_projects_nomenclature_rewrite() {
return array( 'slug' => 'service', 'with_front' => true );
}
@jeffikus
jeffikus / featured-slider.js
Created Apr 18, 2016
Fix for The One Pager featured slider responsiveness with videos
View featured-slider.js
View wooimage-override.php
<?php
/*
Plugin Name: woo_image Override
Plugin URI: http://woothemes.com
Description: Override for the woo_image() function in the WooFramework. This will force the active theme to use native WordPress functions for image handling.
Author: Jeffikus
Version: 1.0.0
Author URI: http://woothemes.com
*/
@jeffikus
jeffikus / gist:b73ea70380ad6c29aed8241c726bb5d5
Last active Apr 7, 2016 — forked from rynaldos/disable-jp-inf-scroll-cond.php
Disable Jetpack's Infinite Scroll for WooCommerce
View gist:b73ea70380ad6c29aed8241c726bb5d5
function _rsp_disable_jetpack_infinite_scroll_conditionally() {
if ( true === is_woocommerce() ) {
remove_theme_support( 'infinite-scroll' );
}
}
add_action( 'template_redirect', '_rsp_disable_jetpack_infinite_scroll_conditionally', 9 );
@jeffikus
jeffikus / testimonials.css
Created Mar 5, 2016
Upstart Testimonials fix
View testimonials.css
/**
* Integration styles
*/
@-webkit-keyframes spin-360 {
from {
-webkit-transform: rotate(0);
-moz-transform: rotate(0);
-ms-transform: rotate(0);
-o-transform: rotate(0);
transform: rotate(0);
View markup.php
<li id="slide-5261" class="slide slide-number-1 flex-active-slide" style="width: 100%; float: left; margin-right: -100%; position: relative; opacity: 1; display: block; z-index: 2;">
<section class="entry col-full">
<p>This is a custom post type slide.&nbsp;Aliquam erat volutpat. Vivamus eget mi velit, sed convallis tellus. Suspendisse sit amet lacinia nisl. Nam tempus mi sed odio fringilla bibendum. Vivamus nisl ipsum, imperdiet eu euismod a, tincidunt aliquam leo. Praesent dolor est, dignissim id placerat id, cursus id diam.</p>
</section>
</li>
@jeffikus
jeffikus / gist:7114667
Created Oct 23, 2013
Filter WordPress Registration URL
View gist:7114667
add_filter('register', 'my_custom_registration_link');
function my_custom_registration_link($link) {
if(!is_user_logged_in()) {
// In this example there is a page with slug 'register' so the url would be http://mysite.com/register
$link = '<div class="status register"><a href="' . site_url('register') . '">' . __('Register') . '</a></div>';
}
return $link;
} // End my_custom_registration_link()
@jeffikus
jeffikus / gist:6931237
Created Oct 11, 2013
Sensei Lessons Archive sort by Menu Order
View gist:6931237
/**
* sensei_filter_lessons_archive function.
* @access public
* @param mixed $wp_query
* @return void
*/
function sensei_filter_lessons_archive( $wp_query ) {
// Handle lesson archive page
if ( is_post_type_archive( 'lesson' ) ) {
You can’t perform that action at this time.