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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Create a new post type called course | |
/*-----------------------------------------------------------------------------------*/ | |
function create_post_type_courses() | |
{ | |
$labels = array( | |
'name' => __( 'Course'), | |
'singular_name' => __( 'Course' ), |
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> | |
<head> | |
<style type="text/css" id="s1" name="s1"> | |
span[class*="row"] { | |
position: absolute; | |
width: 25px; | |
height: 25px; | |
background: #eee; | |
padding: 5px; |
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('update_attached_file', 'convertToGrayscale'); | |
function convertToGrayscale($location,$id) | |
{ | |
$info = getimagesize($location); | |
switch ($info['mime']) | |
{ | |
case 'image/jpeg': |
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: Awesome Twitter Plugin | |
Plugin URI: | |
Description: Adds a function to grab your latest tweets and caches them in the database. | |
Author: Patrick Arlt | |
Version: 0.01 | |
Author URI: http://patrickarlt.com | |
*/ |
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 | |
// Register the column | |
function price_column_register( $columns ) { | |
$columns['price'] = __( 'Price', 'my-plugin' ); | |
return $columns; | |
} | |
add_filter( 'manage_edit-post_columns', 'price_column_register' ); |
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 | |
// Register the column | |
function price_column_register( $columns ) { | |
$columns['price'] = __( 'Price', 'my-plugin' ); | |
return $columns; | |
} | |
add_filter( 'manage_edit-post_columns', 'price_column_register' ); |
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 | |
/* | |
Script Name: Wordpress Hooks & Filters Flow | |
Plugin URI: http://planetozh.com/blog/my-projects/wordpress-hooks-filter-flow/ | |
Description: Lists hooks and their associated filters/actions for your blog. Meant to provide debugging help. | |
Version: 1.0 | |
Author: Ozh | |
Author URI: http://planetOzh.com/ | |
*/ |
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 to functions.php of Wordpress theme. This function will add | |
<a href="[permalink]" class="readmore">More »</a> | |
at the end of the excerpt. |
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
<div id="feedbackGadget" style="left: 359px; top: 20px; visibility: hidden; display: none; " class="gn-gaiabar-gadget"> | |
<div id="feedbackIframe"> | |
<iframe id="feedbackIframeId" name="feedbackIframeId" class="gn-gaiabar-iframe" src="https://spreadsheets.google.com/embeddedform?key=pPo2nzr1TywUz6Kp4cvV6NA&hl=en&gridId=0" frameborder="0" style="height: 320px; width: 480px;"> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Feedback</title> |
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 | |
/** | |
* Shortens an UTF-8 encoded string without breaking words. | |
* | |
* @link http://wordpress.stackexchange.com/q/11085/11089#11089 | |
* @param string $string string to shorten | |
* @param int $max_chars maximal length in characters | |
* @param string $append replacement for truncated words. | |
* @return string | |
*/ |