Skip to content

Instantly share code, notes, and snippets.

:octocat:
Searching for talents

Frank Bültge bueltge

:octocat:
Searching for talents
View GitHub Profile
View post-type--not-in.php
<?php
/**
* This class will cause WP_Query to ignore a 'post_type' parameter when 'post_type__not_in' is set.
*
* Class Post_Type__Not_In
*/
class Post_Type__Not_In {
/**
*
@bueltge
bueltge / mlp-filter-site.php
Last active Sep 16, 2015
MultilingualPress Add on to filter non public sites.
View mlp-filter-site.php
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: MultilingualPress Add on to hide Non-public Sites
* Description: This is a simple add-on for the MultilingualPress plugin to hide non-public sites (i.e., languages) from translation lists such as the Language Switcher widget or the Quicklinks.
* Author: Inpsyde GmbH
* Author URI: http://inpsyde.com
* Version: 2015-09-16
* License: GPLv2+
* Network: true
*/
View comments.php
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/comment.js"></script>
<?php if (!empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
<div class="errorbox">
<?php _e('Enter your password to view comments.', 'inove'); ?>
</div>
<?php return; endif; ?>
<?php
$options = get_option('inove_options');
@bueltge
bueltge / gist:1038032
Created Jun 21, 2011
Transition form bw 2 color with canvas
View gist:1038032
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>untitled</title>
<style>
/* Setup...not important. */
.img-wrap {
width: 500px;
@bueltge
bueltge / gist:1119722
Created Aug 2, 2011
Debug Shortcodes
View gist:1119722
function fb_show_shortcodes( $atts, $content = NULL ) {
extract( shortcode_atts(
array('linebreak'=>''),
$atts
) );
$brackets = array();
$brackets[0] = "/\[/";
$brackets[1] = "/\]/";
@bueltge
bueltge / gist:1155369
Created Aug 18, 2011
has_shortcode()
View gist:1155369
// check the current post for the existence of a short code
function has_shortcode( $shortcode = NULL ) {
$post_to_check = get_post( get_the_ID() );
// false because we have to search through the post content first
$found = false;
// if no short code was provided, return false
if ( ! $shortcode ) {
@bueltge
bueltge / gist:1168439
Created Aug 24, 2011
Adds classes for custom taxonomies to body_class()
View gist:1168439
function fb_add_body_class( $class ) {
if ( ! is_tax() )
return $class;
$tax = get_query_var( 'taxonomy' );
$term = $tax . '-' . get_query_var( 'term' );
$class = array_merge( $classes, array( 'taxonomy-archive', $tax, $term ) );
return $class;
@bueltge
bueltge / get_ram_in_footer.php
Last active Sep 27, 2015
WordPress Plugin to list used and standing ready RAM and SQL Queries in Admin-Footer
View get_ram_in_footer.php
@bueltge
bueltge / gist:1218587
Created Sep 15, 2011
Add WordPress post thumbnail to feed
View gist:1218587
// show post thumbnails in feeds
function fb_post_thumbnail_2_feeds( $content ) {
if ( has_post_thumbnail( get_the_ID() ) )
$content = '<div>' . get_the_post_thumbnail( get_the_ID() ) . '</div>' . $content;
return $content;
}
add_filter( 'the_excerpt_rss', 'fb_post_thumbnail_2_feeds' );
add_filter( 'the_content_feed', 'fb_post_thumbnail_2_feeds' );
@bueltge
bueltge / gist:1242366
Created Sep 26, 2011
How to use AJAX with WordPress to post and process Javascript
View gist:1242366
<?php
/*
* Example of how to use AJAX with WordPress to post and process Javascript arrays of objects.
* Drop this in your WordPress theme's functions.php file and it will display the array of objects on page load in the admin
* REF: http://lists.automattic.com/pipermail/wp-hackers/2011-September/040834.html
* By: Mike Schinkel - http://about.me/mikeschinkel
*/
add_action( 'admin_init', 'mytheme_admin_init' );
function mytheme_admin_init() {
wp_enqueue_script('jquery');
You can’t perform that action at this time.