Skip to content

Instantly share code, notes, and snippets.

View pommiegranit's full-sized avatar

Chris Knowles pommiegranit

  • Melbourne, Australia
View GitHub Profile
@pommiegranit
pommiegranit / ft_shortcode.php
Last active August 29, 2015 13:57
WordPress Flowtime Integration
function ft_shortcode( $atts, $content = null){
$html_element = 'span';
if ( $atts == '' ) {
$ft_classes = 'ft-fragment';
} else {
<div id="content" class="col-full">
<section id="main" class="col-left">
<!-- begin search form -->
<form action="/library" method="post">
<p>
<label for="query"><?php _e( 'Search', 'woothemes' ); ?></label>
<input type="text" name="query" id="query" value="<?php echo esc_attr( $query ); ?>" />
@pommiegranit
pommiegranit / action-feature.php
Last active August 29, 2015 13:56
Updates to Scheduled Content Actions plugin to add two new actions
<?php
/**
* Feature Name: Action Feature (handles feature and unfeature)
* Author: Chris Knowles
* Author URI: http://premium.wpmudev.org
* Licence: GPLv3
*/
add_action( 'sca_do_feature_content', 'sca_feature_content' );
<?php
/**
* Plugin Name: Sidr - Side Menus
* Plugin URI: http://wpmu.org
* Description: Adds the Sidr plugin to WordPress. Sidr is a jQuery plugin written by Alberto Valero http://www.berriart.com/sidr/
* Version: 1.0
* Author: Chris Knowles
* Author URI: http://wpmu.org
* License: GPL2
*/
@pommiegranit
pommiegranit / hashcode.js
Last active August 29, 2015 13:56
Paragraph Commenting Snippets
// this function courtesu of Werx Limited
// http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
String.prototype.hashCode = function(){
var hash = 0;
if (this.length == 0) return hash;
for (i = 0; i < this.length; i++) {
char = this.charCodeAt(i);
hash = ((hash<<5)-hash)+char;
@pommiegranit
pommiegranit / ajax-search.php
Last active August 29, 2015 13:56
Replacement search page to address NNG recommendations
function suggsearch() {
$sugg = esc_html($_POST['suggestion']);
$post_list = new WP_Query( 's=' . $sugg );
if ( $post_list->have_posts() ) :
// Start the Loop.
while ( $post_list->have_posts() ) : $post_list->the_post();
@pommiegranit
pommiegranit / supercharged-post-navigation.php
Last active April 14, 2017 20:44
Provides a WordPress template tag that outputs a much more eye-catching "next" post navigation
<?php
/**
* Plugin Name: Supercharged Post Navigation
* Plugin URI: http://premium.wpmudev.org/blog
* Description: Provides a much enhanced post navigation via supercharged_post_navigation function
* Version: 1.0
* Author: Chris Knowles
* Author URI: http://premium.wpmudev.org/blog/author/chrisdknowles
* License: GPL2
*/
<?php
/*
Plugin Name: Global Conditional Notification
Description: Provides global notifications with conditional content
Version: 1.0
Author: Chris Knowles
Plugin URI: http://
Author URI: http://premium.wpmudev.org/blog/author/chrisdknowles/
Author: Bas Matthee
@pommiegranit
pommiegranit / bulk-term-remover.php
Last active January 4, 2016 21:19
A plugin that adds a new "remove terms" action to the All Posts Bulk Actions menu to allow categories and terms to be removed from multiple posts
<?php
/*
Plugin Name: Bulk Term Remover
Plugin URI:
Description: Remove tags or categories from multiple posts in the post list screen
Author: Chris Knowles based on plugin by Justin Stern.
Author URI: http://premium.wpmudev.org
Version: 0.1
Original URL: http://www.foxrunsoftware.net/articles/wordpress/add-custom-bulk-action/
Original Author: Justin Stern