Skip to content

Instantly share code, notes, and snippets.

View colegeissinger's full-sized avatar

Cole Geissinger colegeissinger

View GitHub Profile
@colegeissinger
colegeissinger / header.php
Last active December 28, 2015 19:29
No index for makers database
<?php // Inject this code near the top of the header.php like below the title or somewhere around there ?>
<?php if ( get_post_type == 'maker' ) {
echo '<meta name="robots" content="noindex, follow">';
} ?>
@colegeissinger
colegeissinger / shortcodes.php
Last active December 28, 2015 08:49
It is recommended to automate any static links and use get_permalink() when possible. This will allow us to future proof our code and allow WordPress to generate these URLs. Get the post ID and pass that through get_permalink() for that specific post.
$output = '<div class="sip-promo-area ' . esc_attr( $align ) . '"><a href="' . get_permalink( 348718 ) . '"><img src="'.get_stylesheet_directory_uri().'/images/3DPrintingSIP_Widget_Final.jpg" class="" style="width:234px; height: auto;" /></a></div>';
<div class="span12 footer_copyright text-center">
- <p><a href="http://makezine.com/">Make:</a> and <a href="http://makerfaire.com/">Maker Faire</a> are registered trademarks of <a href="http://makermedia.com/">Maker Media, Inc.</a><br>
- Copyright &copy; 2004-<?php echo date("Y") ?> Maker Media, Inc. All rights reserved<br>
- <?php if ( function_exists('vip_powered_wpcom') ) { echo vip_powered_wpcom(4); } ?>
- </p>
+ <p><a href="http://makezine.com/">Make:</a> and <a href="http://makerfaire.com/">Maker Faire</a> are registered trademarks of <a href="http://makermedia.com/">Maker Media, Inc.</a></p>
+ <p>Copyright &copy; 2004-<?php echo date("Y") ?> Maker Media, Inc. All rights reserved</p>
+ <p><?php if ( function_exists('vip_powered_wpcom') ) { echo vip_powered_wpcom(4); } ?></p>
</div>
diff --git a/plugins/gigya/resources/core.php b/plugins/gigya/resources/core.php
index fcad6fa..5e3ed74 100644
--- a/plugins/gigya/resources/core.php
+++ b/plugins/gigya/resources/core.php
@@ -34,13 +34,13 @@ class GigyaSO_Core {
$header_text = (isset($params["header_text"]) ? $params["header_text"] : __("Sign in with your Social Network:"));
- if($params["width"]) {
+ if( isset( $params["width"] ) ) {
@colegeissinger
colegeissinger / popup.php
Created October 28, 2013 23:05
An example of a popup window's php file within TinyMCE's windowManager
<?php
// Load up WordPress into our iFrame
$absolute_path = __FILE__;
$path_to_file = explode( 'wp-content', $absolute_path );
$path_to_wp = $path_to_file[0];
require_once( $path_to_wp . 'wp-load.php' );
if ( ! is_user_logged_in() || ! current_user_can( 'edit_posts' ) )
wp_die( 'Oops! You can\'t call this page directly.' );
<a href="<?php the_permalink(); ?>">
<span class="arrows">&raquo;</span> <h3 class="look_like_h4"><?php the_title(); ?></h3>
<span class="blurb">
<?php echo wp_trim_words(strip_shortcodes( get_the_excerpt() ), 20, '...') ; ?>
</span>
</a>
@colegeissinger
colegeissinger / live.html
Last active December 23, 2015 14:39
MF Live
<h1 class="red">World Maker Faire New York: Live</h1>
[ustream id=16033689 live=1 hwaccel=1 version=3 width=940 height=529]
<h1 class="red"><a class="red" href="http://makerfaire.com/location/make-live-stage-a_zone-c/" title="Make: Live Stage">Make: Live Stage</a> - The Air Rocket Glider</h1>
[youtube=http://www.youtube.com/watch?v=JaNH56Vpg-A&w=940&h=529]
<h3>Watch More Great Videos from World Maker Faire New York 2013</h3>
<p><a href="#" target="_blank">TEST OLD STHINGSOGNAUIH UWYGFUYW</a></p>
@colegeissinger
colegeissinger / index.php
Last active December 21, 2015 20:39
An example of a small PHP script for a presentation I gave on August 28th, 2013 for WIMP (Web and Interactive Media Professionals) http://www.meetup.com/beawimp/events/130142102/
<?php
// Setup some static variables for us to use
$title = 'Our Simple PHP Page'; // We'll create a string for the title tag of the page
$year = 2013; // We'll also create a variable that will contain the year which is used in the footer
// We'll also create an array that holds multiple author information
// If we leave the array key's blank, that makes this an "indexed" array.
// Each key-pair will work on a base of 0 and count up (E.G. 0 => 'value', 1 => 'value 2')
$authors = array(
'Author 1',
function make_post_statuses() {
global $wp_post_statuses;
foreach ( $wp_post_statuses as $status => $name ) {
if ( $status != 'trash' && $status != 'publish' && $status != 'auto-draft' )
$statuses[] = $status;
}
return $statuses;
}
@colegeissinger
colegeissinger / wp-header-home-js.php
Last active December 18, 2015 11:38
Add JS to homepage of WordPress site
// Save your JavaScript to a file like mobile-redirect.js and we'll assume it's in a directory called "js" in your themes root
// Now use this code to add to your WordPress theme in your functions.php
function cg_add_custom_js_script() {
// more info on this function here http://codex.wordpress.org/Function_Reference/wp_enqueue_script
if ( is_home() || is_front_page() )
wp_enqueue_script( 'custom-js-id', get_stylesheet_directory_uri() . '/js/mobile-redirect.js' );
}
add_action( 'wp_enqueue_scripts', 'cg_add_custom_js_script' );