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 | |
if (function_exists('childtheme_override_page_title')) { | |
function thematic_page_title() { | |
childtheme_override_page_title(); | |
} | |
} else { | |
function thematic_page_title() { | |
/* code for the page 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 | |
// Add support for post thumbnails of 250px square | |
// Add custom image size for wpf thumbnails | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support( 'post-thumbnails' ); | |
set_post_thumbnail_size( 270, 270, true ); | |
add_image_size('wpf-thumb', 270, 270, true); | |
} |
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 | |
if ( function_exists( 'add_theme_support' ) ) { | |
// Add support for post thumbnails | |
add_theme_support( 'post-thumbnails' ); | |
// Change thumbnail size to 270 x 270 with cropping | |
set_post_thumbnail_size( 270, 270, true ); | |
// Create a custom image size of 270 x 270 with cropping | |
add_image_size('wpf-thumb', 270, 270, true); | |
} |
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 post attachments | |
function wpf_get_attachments() { | |
global $post; | |
return get_posts( | |
array( | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image') | |
); |
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 the URL of the first attachment image and turn it into the 'auto thumb'. If no attachments, display default-thumb.png | |
function wpf_get_first_thumb_url() { | |
// Add these classes to the attachment so that the 'auto thumb' style matches the style of featured image's | |
$attr = array( | |
'class' => "attachment-post-thumbnail wp-post-image"); | |
$imgs = wpf_get_attachments(); |
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 | |
//////////////////////// | |
// CALENDAR FUNCTIONS // | |
//////////////////////// | |
/* | |
Function to Draw the calendar and it's controls. |
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 | |
// Make featured image thumbnail a permalink | |
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); | |
function my_post_image_html( $html, $post_id, $post_image_id ) { | |
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>'; | |
return $html; | |
} |
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 | |
while (have_posts()) : the_post(); | |
?> | |
<span class="thumb-list"> | |
<div id="post-<?php the_ID(); | |
echo '"> '; | |
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { | |
the_post_thumbnail(); | |
} else { ?> | |
<a href="<?php the_permalink();?>"><?php wpf_get_first_thumb_url(); ?></a> |
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 | |
// Filter the gallery shortcode defaults | |
// http://wordpress.stackexchange.com/questions/4343/how-to-customise-the-output-of-the-wp-image-gallery-shortcode-from-a-plugin | |
add_filter( 'post_gallery', 'my_post_gallery', 10, 2 ); | |
function my_post_gallery( $output, $attr) { | |
global $post, $wp_locale; | |
static $instance = 0; | |
$instance++; |
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
/* Thumbnails */ | |
span.thumb-list { | |
float:left; | |
padding-left:11px; | |
margin:auto; | |
} | |
h4.thumb-title,h4.thumb-title a,h4.thumb-title a:hover { | |
font-size:.8em; |