Skip to content

Instantly share code, notes, and snippets.

@raamdev
raamdev / gist:8550578
Last active January 4, 2016 01:49
WordPress Shortcode for outputting a list of recent posts. Includes many options.
<?php
if ( ! function_exists( 'independent_publisher_recent_posts_shortcode' ) ) :
/**
* Returns recent posts for given category and excludes given post formats
*
* Example usage: [independent_publisher_recent_posts count="10" category="Technology" exclude_formats="aside,gallery,link" more_text="« Full Archives"]
*/
function independent_publisher_recent_posts_shortcode( $atts /*$number_posts = '10', $category = '', $exclude_formats = array()*/ ) {
$formats_to_exclude = '';
<?php
/* Add a checkbox to the featured image metabox */
add_filter( 'admin_post_thumbnail_html', 'theme_featured_image_meta');
function theme_featured_image_meta( $content ) {
global $post;
// Text for checkbox
$text = __( "Don't display image on post.", 'textdomain' );
@raamdev
raamdev / postie-functions.php
Created March 21, 2013 19:51
Adds support for Post Formats to the WordPress Postie plugin. You can now specify a post format in the email subject like this: "Aside :: My Aside-formatted post". My changes to postie-functions.php can be found on lines L232, L305, L402, L803, and L2421.
<?php
/*
$Id: postie-functions.php 683869 2013-03-18 21:39:57Z WayneAllen $
*/
//to turn on debug output add the following line to wp-config.php
//define('POSTIE_DEBUG', true);
if (!function_exists('mb_str_replace')) {
@raamdev
raamdev / flickr-random-photo.php
Created October 6, 2012 05:49
Load a Flickr photo set and then display a random photo from that set
<?php
/**
* Raam Dev - http://raamdev.com/
*
* This code loads a Flickr Photo Set and then picks a random photo from that set
* After configuring your settings and loading the PHP, you can display the random photo as follows:
* <a href="<?php echo $flickr_img_url_large; ?>" title="<?php echo $flickr_photo_description; ?>">
* <img title="<?php echo $flickr_photo_description; ?>" border="0" src="<?php echo $flickr_img_url; ?>" />
* </a>
*