This file contains hidden or 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
//PAGINATION// | |
/* Function that Rounds To The Nearest Value. | |
Needed for the pagenavi() function */ | |
function round_num($num, $to_nearest) { | |
/*Round fractions down (http://php.net/manual/en/function.floor.php)*/ | |
return floor($num/$to_nearest)*$to_nearest; | |
} | |
/* Function that performs a Boxed Style Numbered Pagination (also called Page Navigation). | |
Function is largely based on Version 2.4 of the WP-PageNavi plugin */ |
This file contains hidden or 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
//email share function | |
function direct_email($text="Send by email"){ | |
global $post; | |
$title = htmlspecialchars($post->post_title); | |
$excerpt = htmlspecialchars($post->the_excerpt); | |
$subject = 'Article by '.htmlspecialchars(get_bloginfo('name')).': '.$title . $excerpt; | |
$body = 'Check out this article from Justin W Hall: '.$title. "\n" . "\n" .get_permalink($post->ID); | |
$link = '<a rel="nofollow" href="mailto:?subject='.rawurlencode($subject).'&body='.rawurlencode($body).'" title="'.$text.' : '.$title.'">'.$text.'</a>'; | |
return $link; | |
} |
This file contains hidden or 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 author_highlight() { | |
global $comment; | |
if ($comment->user_id == get_the_author_meta('ID')) { echo "highlighted"; } | |
} |
This file contains hidden or 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 display_latest_tweets( | |
$twitter_user_id = 'justinwhall', | |
$cache_file = 'twitter.txt', | |
$tweets_to_display = 1, | |
$ignore_replies = false, | |
$twitter_wrap_open = '<ul id="twitter">', | |
$twitter_wrap_close = '</ul>', | |
$tweet_wrap_open = '<li><span class="status">', | |
$meta_wrap_open = '</span><span class="meta"> ', | |
$meta_wrap_close = '</span>', |
This file contains hidden or 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 | |
/** | |
* Master theme class | |
* @since 1.0 | |
*/ | |
class My_Theme_Options { | |
private $sections; | |
private $checkboxes; |
This file contains hidden or 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
/** | |
* Filter TinyMCE Buttons | |
* | |
* Here we are filtering the TinyMCE buttons and adding a button | |
* to it. In this case, we are looking to add a style select | |
* box (button) which is referenced as "styleselect". In this | |
* example we are looking to add the select box to the second | |
* row of the visual editor, as defined by the number 2 in the | |
* mce_buttons_2 hook. | |
*/ |
This file contains hidden or 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
//Custom Login image | |
add_action("login_head", "my_login_head"); | |
function my_login_head() { | |
echo " | |
<style> | |
body.login #login h1 a { | |
background: url('".get_bloginfo('template_url')."/images/newlogo.png') no-repeat scroll center top transparent; | |
height: 152px; | |
width: 330px; | |
} |
This file contains hidden or 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 wp_bac_breadcrumb() { | |
//Variable (symbol >> encoded) and can be styled separately. | |
//Use >> for different level categories (parent >> child >> grandchild) | |
$delimiter = '<span class="delimiter"> » </span>'; | |
//Use bullets for same level categories ( parent . parent ) | |
$delimiter1 = '<span class="delimiter1"> • </span>'; | |
//text link for the 'Home' page | |
$main = 'Home'; | |
//Display only the first 30 characters of the post title. |
This file contains hidden or 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 children pages AND the sibling pages ONLY when on child pages | |
if($post->post_parent) | |
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order&depth=1"); | |
else | |
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&sort_column=menu_order&depth=1"); | |
if ($children) : | |
?> | |
<div id="child-menu" > | |
<ul> |
This file contains hidden or 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
jQuery(document).ready(function() { | |
jQuery('.st_upload_button').click(function() { | |
/* formfield = jQuery('#st_upload').attr('name'); */ | |
targetfield = jQuery(this).prev('.upload-url'); | |
tb_show('', 'media-upload.php?type=image&TB_iframe=true'); | |
return false; | |
}); | |
window.send_to_editor = function(html) { |
OlderNewer