Skip to content

Instantly share code, notes, and snippets.

View patrikthors's full-sized avatar

Patrik Thors patrikthors

View GitHub Profile
@mikeschinkel
mikeschinkel / list-custom-post-type-posts-with-ajax.PHP
Created November 13, 2010 10:04
Shows how to create a widget with a dropdown list of posts for a given post type and then retrieve HTML specific to the selected post via AJAX to insert into the page.
<?php
/*
List_Custom_Post_Type_Posts_with_AJAX class.
Shows how to create a widget with a dropdown list of posts for a given post type and
then retrieve HTML specific to the selected post via AJAX to insert into the page.
Yes, the name of the class is insanely long in hopes that you'll be forced to think
about what would be a better name.
# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]
@thefrosty
thefrosty / WordCamp Vegas Plugability
Created December 14, 2011 01:03
Core functionality plugin.
<?php
/**
* Plugin Name: PluginName
* Plugin URI: http://austinpassy.com/wordpress-plugins/
* Description: Core functionality for __________
* Version: 1.0.0
* Author: Austin Passy
* Author URI: http://austinpassy.com/
*
* @copyright 2012
@jbreitenbucher
jbreitenbucher / widgets.php
Created January 20, 2012 20:44
Genesis: Customization of Featured Page and Post Widgets
<?php
/** Remove the Genesis Featured Post widget */
add_action( 'widgets_init', 'faculty_unregister_widgets' );
function faculty_unregister_widgets() {
unregister_widget( 'Genesis_Featured_Post' );
unregister_widget( 'Genesis_Featured_Page' );
}
add_action('widgets_init', create_function('', "register_widget('Faculty_Featured_Post');"));
add_action('widgets_init', create_function('', "register_widget('Faculty_Featured_Page');"));
@mikeschinkel
mikeschinkel / functions.php
Created February 3, 2012 07:43
Master WordPress Custom Post Types - WordCamp Atlanta 2012
<?php
/*
* Code Examples for Master WordPress Custom Post Types - WordCamp Atlanta 2012
*
* Author: Mike Schinkel
* Author URI: http://about.me/mikeschinkel
*
*/
add_action( 'init', 'mikes_theme_init' );
function mikes_theme_init() {
@billerickson
billerickson / gist:2040968
Last active February 22, 2017 01:56
Grid Loop using post class
<?php
/**
* Archive Post Class
* @since 1.0.0
*
* Breaks the posts into three columns
* @link http://www.billerickson.net/code/grid-loop-using-post-class
*
* @param array $classes
@mikeschinkel
mikeschinkel / rootbased-taxonomy-urls.php
Created March 26, 2012 04:29
Root-based Taxonomy URLs Plugin for WordPress
<?php
/*
* Plugin Name: Root-based Taxonomy URLs for WordPress
* Description: Enables root-based Taxonomy URLs, i.e. Makes /taxonomy/my-taxonomy/ URLs route as /my-taxonomy/
* Author: Mike Schinkel
* Author URI: http://about.me/mikeschinkel
* Plugin URI: https://gist.github.com/1421235
* Version: 0.1
* License: GPL 2+
* Notes: Must use register_root_based_taxonomy_url( $taxonomy[, $priority] ) in an 'init' hook to specify root_based taxonomy.
@fedemp
fedemp / featured-page-widget.php
Created April 3, 2012 01:08
featured-page-widget edited cause it breaks on one of my projects
@bueltge
bueltge / set-featured-image.php
Created June 14, 2012 12:41
Set featureed image automaticly on save post/page
@Abban
Abban / WordPress Theme Customizer Sample.php
Created June 21, 2012 21:09
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================