View post-type--not-in.php
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 | |
/** | |
* 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 { | |
/** | |
* |
View mlp-filter-site.php
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 # -*- 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
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
<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'); |
View gist:1038032
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>untitled</title> | |
<style> | |
/* Setup...not important. */ | |
.img-wrap { | |
width: 500px; |
View gist:1119722
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
function fb_show_shortcodes( $atts, $content = NULL ) { | |
extract( shortcode_atts( | |
array('linebreak'=>''), | |
$atts | |
) ); | |
$brackets = array(); | |
$brackets[0] = "/\[/"; | |
$brackets[1] = "/\]/"; |
View gist:1155369
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
// 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 ) { |
View gist:1168439
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
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; |
View gist:1218587
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
// 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' ); |
View gist:1242366
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 | |
/* | |
* 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'); |
OlderNewer