Skip to content

Instantly share code, notes, and snippets.

View norcross's full-sized avatar
somone said this would be easy. someone LIED.

Norcross norcross

somone said this would be easy. someone LIED.
View GitHub Profile
@norcross
norcross / remove-month-dropdown.php
Created November 5, 2014 03:48
remove the month drop down from post types
<?php
add_filter( 'months_dropdown_results', 'rkv_remove_month_filters' ), 10, 2 );
/**
* remove the month drop down filter by
* spoofing WP and saying that none exist
* for specific post types
*
* @param array $months the original count
* @param string $post_type the post type
@norcross
norcross / wp-comment-noreply-meta.php
Created November 25, 2014 03:38
remove the noindex meta tag from single reply comment links
<?php
add_action( 'init', 'rkv_comment_noindex_base' );
/**
* remove the noindex flag on the reply links
* when not using Yoast SEO
*
* @return null
*/
function rkv_comment_noindex_base() {
@norcross
norcross / cun-notify-single.php
Created January 20, 2015 14:53
filter the content notification to a single post ID
<?php
add_filter( 'cun_single_item_email', 'rkv_single_cun_notify' );
function rkv_single_cun_notify( $post_id ) {
return absint( $post_id ) === absint( THE_ID_I_WANT ) ? true : false;
}
@norcross
norcross / rkv-bypass-auto-update.php
Created February 19, 2015 01:21
prevent WordPress from sending emails when the auto update is successful
<?php
/**
* bypass the notification email on successful auto-updates
*
* @param [type] $send [description]
* @param [type] $type [description]
* @param [type] $core_update [description]
* @param [type] $result [description]
* @return [type] [description]
*/
@norcross
norcross / shortcode-clean.php
Created April 27, 2015 16:58
remove some weird tags on shortcodes
<?php
add_filter( 'the_content', 'rkv_shortcode_cleanup',1001 );
/**
* remove weird tags
*
* @param [type] $content [description]
*/
function rkv_shortcode_cleanup( $content ) {
<?php
/**
* keeps a user always logged in
* don't use this on a production site, ever!
*/
add_action( 'init', 'rkv_auto_login' );
add_action( 'admin_init', 'rkv_auto_login' );
@norcross
norcross / voc_priceeditor.php
Created September 9, 2011 20:30
Mass Price Update for Shopp
<?php
function vol_price_css() {
$theme_dir = get_bloginfo('template_directory');
?>
<style type="text/css">
.shopp h2.voc_title {padding: 12px 15px 25px 0;}
.icon32 {background: url(<?php echo $theme_dir;?>/lib/img/shopp32.png) no-repeat scroll 0 0 transparent;}
.vcc_price_update_btn { position:absolute; top:47px; left:400px;}
table.price-editor tr.headers th{font-weight:bold;}
@norcross
norcross / aweber_widget.php
Created October 24, 2011 20:15
Aweber Opt-in Widget
<?php
/**
* Aweber widget
*/
class aweber_Widget extends WP_Widget {
function aweber_Widget() {
$widget_ops = array( 'classname' => 'aweber', 'description' => 'Displays the aweber opt-in form' );
$this->WP_Widget( 'aweber', 'Aweber Form', $widget_ops );
}
@norcross
norcross / rkv-admin-style.css
Created December 13, 2011 12:29
WP Admin Skin
@charset "utf-8";
/* CSS Document */
html, body {
height: 100%;
}
html {
background-color: #fff;
}
body.login {
background:#1D2736;
@norcross
norcross / gist-sidebar-widget
Created December 24, 2011 03:24
Public Gist Sidebar Widget
<?php
/*
Plugin Name: GitHub Gists Sidebar Widget
Plugin URI: http://andrewnorcross.com/plugins
Description: A sidebar widget to display your public gists from GitHub.
Version: 1.0
Author: norcross
Author URI: http://andrewnorcross.com
*/
/* Copyright 2012 Andrew Norcross