Skip to content

Instantly share code, notes, and snippets.

View jkudish's full-sized avatar

Joey Kudish jkudish

View GitHub Profile
<h1>Upcoming events:</h1>
<?php global $post;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$upcoming = tribe_get_events( array('eventDisplay'=>'past', 'posts_per_page'=>1,'paged' => get_query_var('page')) );
foreach($upcoming as $post) : setup_postdata($post);?>
<div class="single-event">
<div class="title"><a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?>
</a> </div>
<?php endforeach; ?>
@jkudish
jkudish / gist:1338692
Created November 4, 2011 05:02
THIS FILE EXPLAINS HOW TO USE THE sld_register_taxonomy() FUNCTION
<?php
// THIS FILE EXPLAINS HOW TO USE THE sld_register_taxonomy() FUNCTION FROM THE FOLLOWING WP PLUGIN: https://github.com/jkudish/sld-custom-content-and-taxonomies
/**
* sld_register_taxonomy()
* @param $taxonomy_slug the slug of the taxonomy to register
* @param $post_types, the post types that use this taxonomy
* @param $optional_singular_name, the singular name for this post type
* @param $optional_args can be passed all of the same arguments as register_taxonomy()
@jkudish
jkudish / gist:1338686
Created November 4, 2011 04:53
THIS FILE EXPLAINS HOW TO USE THE sld_register_post_type() function
<?php
// THIS FILE EXPLAINS HOW TO USE THE sld_register_post_type() FUNCTION FROM THE FOLLOWING WP PLUGIN: https://github.com/jkudish/sld-custom-content-and-taxonomies
/**
* sld_register_post_type()
* @param $post_type_slug the slug of the type to register
* @param $optional_args can be passed all of the same arguments as register_post_type()
* @see http://codex.wordpress.org/Function_Reference/register_post_type
* @param $optional_custom_plural, the plural name for this post type
@jkudish
jkudish / archive-cpt.php
Created October 5, 2011 05:36
Modify a query to show an archive of CPTs
<?php
add_action('pre_get_posts', 'ipstenu_pre_get_posts');
function ipstenu_pre_get_posts($query){
if ($query->is_page('name-of-your-page')) { // any and all conditionals work here as a method of the $query object
$query->set('post_type', 'video'); // use the set method as if you were using a regular WP_Query or query_posts etc...
$query->set('posts_per_page', 10);
}
}
$ whois google.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
GOOGLE.COM.ZZZZZZZZZZZZZ.GET.ONE.MILLION.DOLLARS.AT.WWW.UNIMUNDI.COM
GOOGLE.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM
$ whois google.ca
Domain name: google.ca
Domain status: registered
Creation date: 2000/10/03
Expiry date: 2012/04/28
Updated date: 2011/03/27
Registrar:
Name: Webnames.ca Inc.
Number: 70
@jkudish
jkudish / sslfix.php
Created October 3, 2011 22:03
A one function WordPress plugin which fixes the plugin update API to allow SSL downloads
<?php
/*
Plugin Name: SSL File API Fix
Plugin URI: http://jkudish.com/
Description: A one function plugin which fixes the plugin update API to allow SSL downloads
Version: 0.1
Author: Joachim Kudish
Author URI: http://jkudish.com/
License: GPLv2
*/
@jkudish
jkudish / rm_dashboard_widgets.php
Created September 18, 2011 21:38
WordPress remove core dashboard widgets
<?php
add_action('wp_dashboard_setup', 'rm_dashboard_widgets');
function rm_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); // right now [content, discussion, theme, etc]
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); // plugins
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); // incoming links
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // wordpress blog
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // other wordpress news
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // quickpress
@jkudish
jkudish / limit_submissions_by_ip.php
Created September 1, 2011 23:50
filters a Gravity Form to prevent submissions from an already submitted IP, good for spam prevention
<?php
/**
* limit_submissions_by_ip()
* filters a Gravity Form to prevent submissions from an already submitted IP, good for spam prevention
* change the ID to match your form (ex: gform_pre_render_6)
* @param $form (array) the form
* @return $form (array) the filtered form
* @author Joachim Kudish <[email protected]>
* @link http://jkudish.com
*/
<? if ( !is_user_logged_in() && (DEVENV != 'on') ): ?>
<div id="header-login-text">
<? if ( bp_get_signup_allowed() ) : ?>
<? printf( __( '<a class="create-account" href="%s" title="Create an account">Create an account</a>', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
<? endif; ?>
<?= 'or'; jfb_output_facebook_btn(); ?>
<? kj_dev_only(); ?>
</div>
<? endif; ?>