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 | |
/** | |
* Get stuff ID by nicename | |
* @param $nicename string The nicename (i.e: post-slug) to get the ID for | |
* @param $type string The table that will be queried: posts (default), term, users | |
* @return integer The ID for the requested object, false if nothing found | |
*/ | |
function get_by_name($nicename, $type="posts"){ | |
global $wpdb; | |
if ( empty($type) OR $type === 'post'){ |
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 include_once(ABSPATH . WPINC . '/rss.php'); | |
$rss = fetch_feed('http://twitter.com/statuses/user_timeline/13436616.rss'); | |
$maxitems = $rss->get_item_quantity(3); | |
$rss_items = $rss->get_items(0, $maxitems); | |
?> | |
<ul> | |
<?php if ($maxitems == 0) echo '<li>No items.</li>'; | |
else | |
// Loop through each feed item and display each item as a hyperlink. | |
foreach ( $rss_items as $item ) : ?> |
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 | |
/****************************************************************************************************************** | |
Plugin Name: cets_blog_defaults | |
Plugin URI: | |
Description: WordPressMU plugin for site admin to set defaults for new blogs. | |
Version: 1.2.3 |
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
<!-- HTML5 Geolocation with Fallback to Google Ajax API | |
-- http://marcgrabanski.com/article/html5-geolocation-fallback-google-ajax-api | |
--> | |
<script src="http://www.google.com/jsapi?key=YOUR_API_KEY" type='text/javascript'></script> | |
<script type='text/javascript'> | |
var myLocation; // global variable to store lat/lng | |
if (navigator && navigator.geolocation) { | |
// HTML5 GeoLocation | |
function getLocation(position) { |
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 | |
/* Cleanup Wordpress Header & use Google Hosted jQuery */ | |
function cleanUp() { | |
function restatement_scripts_unversion($src) { | |
if( strpos($src,'ajax.googleapis.com') ) | |
$src=remove_query_arg('ver', $src); | |
return $src; | |
} |
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('the_excerpt_rss', 'my_fulltext_desc'); | |
function my_fulltext_desc($excerpt) | |
{ | |
if ( ! is_feed() ) | |
{ | |
return $excerpt; | |
} | |
return apply_filters('the_content', get_the_content() ); |
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 | |
/* | |
Plugin Name: Category Custom Fields | |
Author: scribu | |
*/ | |
class Category_Custom_Fields { | |
function init() { |
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 | |
$docs = get_posts('numberposts=-1&post_type=page&post_parent=36&orderby=title&order=ASC'); | |
$faculty = array(); | |
foreach ($docs as $doc) { | |
array_push($faculty, $doc->ID); | |
} | |
$currentElement = array_search($post->ID, $faculty); | |
$next = isset( $faculty[$currentElement+1] ) ? $faculty[$currentElement+1] : null; | |
$prev = isset($faculty[$currentElement-1]) ? $faculty[$currentElement-1] : null; | |
if ( !is_null($prev) ) { |
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 | |
/* | |
posts-by-category-with-price.php | |
Query for a list of WordPress posts by category, | |
but only those with a postmeta->meta_key='Price' that's >0 and NOT NULL. | |
Author: Mike Schinkel (http://mikeschinkel.com) |
OlderNewer