Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_init', 'fs_imagelink_setup', 10 ); | |
/** | |
* Set default link option for attachments | |
* | |
* @return void | |
*/ | |
function fs_imagelink_setup() { | |
$image_set = get_option( 'image_default_link_type' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
remove_action( 'genesis_sidebar', 'ss_do_sidebar' ); | |
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); | |
add_action( 'genesis_sidebar', 'befrank_nieuwsbericht_sidebar' ); | |
/** | |
* Replace default sidebar with news specific | |
*/ | |
function befrank_nieuwsbericht_sidebar() { | |
dynamic_sidebar( 'nieuwsbericht-sidebar' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
**/ | |
* How tot detect is a certain page template is in use. | |
* | |
* @link http://www.wupperpiraten.de/2009/12/is-a-certain-page-template-active/ | |
*/ | |
function is_pagetemplate_active( $pagetemplate = '' ) { | |
global $wpdb; | |
$sql = "select meta_key from $wpdb->postmeta where meta_key like '_wp_page_template' and meta_value like '" . $pagetemplate . "'"; | |
$result = $wpdb->query( $sql ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function auto_featured_image() { | |
global $post; | |
if ( ! has_post_thumbnail( $post->ID ) ) { | |
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); | |
if ( $attached_image ) { | |
foreach ( $attached_image as $attachment_id => $attachment ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'widget_text', array( $wp_embed, 'run_shortcode' ), 8 ); | |
add_filter( 'widget_text', array( $wp_embed, 'autoembed'), 8 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 04f - Column Classes ----------- */ | |
.five-sixths, | |
.four-fifths, | |
.four-sixths, | |
.one-fifth, | |
.one-fourth, | |
.one-half, | |
.one-sixth, | |
.one-third, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'save_post', 'force_check_thumbnail') ; | |
add_action( 'admin_notices', 'show_thumbnail_error' ); | |
/** | |
* Force Featured Image | |
* | |
* @link http://wpdevsnippets.com/require-post-thumbnail-uploaded-before-publishing/ | |
* @param global $post_id | |
* @return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'embed_defaults', 'custom_oembed_defaults' ); | |
/** | |
* Custom WordPress oEmbed widths | |
* @param var $embed_size | |
* @return var | |
*/ | |
function custom_oembed_defaults( $embed_size ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'bp_loaded','bpdev_remove_bp_pre_user_login_action') ; | |
/** | |
* BuddyPress replaces the space with '-' which is not known to the user | |
* We remove the attached function to stop BP from circumventing the space in username | |
* | |
*/ | |
function bpdev_remove_bp_pre_user_login_action(){ | |