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 | |
// we can only use this Widget if the plugin is active | |
if( class_exists( 'WidgetImageField' ) ) | |
add_action( 'widgets_init', create_function( '', "register_widget( 'ITI_Widget_Image_OTM' );" ) ); | |
class ITI_Widget_Image_OTM extends WP_Widget | |
{ | |
var $image_field = 'image'; // the image field ID |
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 | |
function form( $instance ) | |
{ | |
$headline = esc_attr( isset( $instance['headline'] ) ? $instance['headline'] : '' ); | |
$image_id = esc_attr( isset( $instance[$this->image_field] ) ? $instance[$this->image_field] : 0 ); | |
$blurb = esc_attr( isset( $instance['blurb'] ) ? $instance['blurb'] : '' ); | |
$image = new WidgetImageField( $this, $image_id ); | |
?> |
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 | |
function update( $new_instance, $old_instance ) | |
{ | |
$instance = $old_instance; | |
$instance['headline'] = strip_tags( $new_instance['headline'] ); | |
$instance[$this->image_field] = intval( strip_tags( $new_instance[$this->image_field] ) ); | |
$instance['blurb'] = strip_tags( $new_instance['blurb'] ); |
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 | |
function widget( $args, $instance ) | |
{ | |
extract($args); | |
$headline = $instance['headline']; | |
$image_id = $instance[$this->image_field]; | |
$blurb = $instance['blurb']; |
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 | |
// we can only use this Widget if the plugin is active | |
if( class_exists( 'WidgetImageField' ) ) | |
add_action( 'widgets_init', create_function( '', "register_widget( 'ITI_Widget_Image_OTM' );" ) ); | |
class ITI_Widget_Image_OTM extends WP_Widget | |
{ | |
var $image_field = 'image'; // the image field ID |
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 | |
/* Template Name: Home */ | |
global $post; | |
global $handlebars; | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'handlebars', | |
get_bloginfo( 'stylesheet_directory' ) . '/js/handlebars.js', |
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 global $handlebars; ?> | |
<?php if( !$handlebars && has_post_thumbnail() ) : ?> | |
<?php $headshot = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' ); ?> | |
<img src="<?php echo $headshot[0]; ?>" alt="Headshot" class="alignleft" /> | |
<?php elseif( $handlebars ) : ?> | |
{{#if headshot}} |
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
<script id="team-member-spotlight-template" type="text/x-handlebars-template"> | |
{{#if headshot}} | |
<img src="{{headshot}}" alt="Headshot of {{name}}" class="alignleft" /> | |
{{/if}} | |
<h3>{{name}}</h3> | |
<p><a href="{{permalink}}">View more details</a></p> | |
</script> |
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 | |
/* Template Name: Team */ | |
global $post; | |
// if it's an ajax request, return our JSON | |
if( isset( $_POST['ajax'] ) ) | |
{ | |
$args = array( |
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 | |
/** | |
* Prevents the creation of full Administrators by client accounts | |
* Forked from JPB_User_Caps (unable to locate origin) | |
* | |
* @return void | |
* @author Jonathan Christopher | |
*/ | |
if( is_admin() ) |
OlderNewer