Skip to content

Instantly share code, notes, and snippets.

View kopepasah's full-sized avatar
🤖
Solving problems with bots.

Justin Kopepasah kopepasah

🤖
Solving problems with bots.
View GitHub Profile
@kopepasah
kopepasah / column-output.css
Created December 27, 2013 22:35
Creating columns with LESS is easy with this shorthand.
.column {
float: left;
}
.column-wrapper {
overflow: hidden;
}
.column.col-12-12 {
width: 100%;
}
.column.col-11-12 {
get_time_difference( $comment->comment_date );
@kopepasah
kopepasah / header.phtml
Created March 3, 2014 13:26
Template code and information for Expatriate documentation.
<?php
/**
* The Header for Expatriate.
*
* Displays all of the <head> section and
* everything up till <div id="content">
*
* @package expatriate
* @author kopepasah
* @since 1.0.0
<?php
// Add this action, ignore the opening <?php tag and this comment.
add_action( 'expat_enable_minified_styles', '__return_true' );
/** -----------------------------------------------------:[ structure ]:---------- */
=== some code
/** -----------------------------------------------------:[ general ]:---------- */
=== some code
/** -----------------------------------------------------:[ header ]:---------- */
=== some code
@kopepasah
kopepasah / filter-infinite-scroll-text.php
Last active January 24, 2017 22:55
Quickly change Jetpack's Infinite Scroll text on button that loads more posts.
<?php
function filter_jetpack_infinite_scroll_js_settings( $settings ) {
$settings['text'] = __( 'Load more...', 'l18n' );
return $settings;
}
add_filter( 'infinite_scroll_js_settings', 'filter_jetpack_infinite_scroll_js_settings' );
@kopepasah
kopepasah / find.txt
Created March 11, 2014 11:33
Use TextMate to find and replace all tabbed lines with empty lines.
[\t]+[\n]
@kopepasah
kopepasah / add-submodule.bash
Last active August 29, 2015 13:57
This Gist contains code for my 'Easily Add Less CSS Pre-Processor to any WordPress Theme' tutorial on kopepasah.com.
git submodule add [email protected]:kopepasah/wp-theme-toolkit-less.git lib/less
@kopepasah
kopepasah / available-modules.php
Last active August 29, 2015 13:57
One line conditional to check if a Jetpack module is active or not.
Jetpack::get_available_modules();
Array
0 => after-the-deadline
1 => carousel
2 => comments
3 => contact-form
4 => custom-css
5 => enhanced-distribution
6 => gplus-authorship
<?php
// Enqueuing and Using Custom Javascript/jQuery
function custom_load_custom_scripts() {
if ( file_exists( get_stylesheet_directory() . '/js/custom_jquery_additions.js' ) ) {
$url = get_stylesheet_directory_uri() . '/js/custom_jquery_additions.js';
} else if ( file_exists( get_template_directory() . '/js/custom_jquery_additions.js' ) ) {
$url = get_template_directory_uri() . '/js/custom_jquery_additions.js';
}