Created
May 8, 2013 17:55
-
-
Save jrthib/5542219 to your computer and use it in GitHub Desktop.
Thematic Child Theme Override
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 childtheme_override_index_loop() { | |
// Count the number of posts so we can insert a widgetized area | |
$count = 1; | |
$alt = 0; | |
while ( have_posts() ) : the_post(); | |
// action hook for insterting content above #post | |
thematic_abovepost(); | |
?> | |
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> > | |
<?php if(in_category('Videos') && false): ?> | |
<?php | |
if (has_post_thumbnail( $post->ID ) ) { | |
$image = wp_get_attachment_image_src(get_post_thumbnail_ID(), 'news-post-listing'); | |
$imageURL = $image[0]; | |
if($imageURL == '') { | |
$image = simplexml_load_string(get_the_post_thumbnail($post->ID, 'news-post-listing')); | |
//print_r($image); | |
$imageURL = $image->attributes()->src; | |
} | |
?> | |
<a class="videoFeature" href="<?php the_permalink(); ?>"> | |
<img class="playBtn" src="/wp-content/themes/backushospital/images/video_play_btn.png"/> | |
<img class="newsEventsVideoFeature" src="<?php echo $imageURL; ?>"/> | |
</a> | |
<?php | |
} | |
?> | |
<div class="entry-content"> | |
<div class="categories"><?php echo postedInCategories(); ?></div> | |
<?php | |
// creating the post header | |
thematic_postheader(); | |
?> | |
<p class="excerpt"> | |
<?php | |
echo get_the_excerpt(); | |
?> | |
</p> | |
<?php wp_link_pages('before=<div class="page-link">' . __('Pages:', 'thematic') . '&after=</div>') ?> | |
</div><!-- .entry-content --> | |
<?php //thematic_postfooter(); ?> | |
<?php else: ?> | |
<?php $alt = (!$alt) ? 1 : 0; ?> | |
<div class="breakingHealthNews<?php if($alt) echo " alt"; ?><?php if(!has_post_thumbnail( $post->ID ) ) echo " full"; ?>"> | |
<?php if (has_post_thumbnail( $post->ID ) ) { ?> | |
<div class="photo"> | |
<?php | |
$image = wp_get_attachment_image_src(get_post_thumbnail_ID(), 'news-post-listing'); | |
$imageURL = $image[0]; | |
if($imageURL == '') { | |
$image = simplexml_load_string(get_the_post_thumbnail($post->ID, 'news-post-listing')); | |
//print_r($image); | |
$imageURL = $image->attributes()->src; | |
} | |
if(in_category('videos')): | |
?> | |
<img class="playBtn" src="/wp-content/themes/backushospital/images/video_play_btn.png"/> | |
<?php endif; ?> | |
<a href="<?php the_permalink(); ?>"><img class="newsEventsVideoFeature" src="<?php echo $imageURL; ?>"/></a> | |
</div> | |
<?php | |
} | |
?> | |
<div class="text entry-content"> | |
<div class="categories"><?php echo postedInCategories(); ?></div> | |
<!-- <div class="entry-date"><?php the_date(); ?></div> --> | |
<?php | |
// creating the post header | |
thematic_postheader(); | |
?> | |
<p class="excerpt"> | |
<?php | |
//echo preg_replace("/\< *[img][^\>]*[.]*\>/i","",get_excerpt(),1); | |
echo get_the_excerpt(); | |
?> | |
</p> | |
<?php wp_link_pages('before=<div class="page-link">' . __('Pages:', 'thematic') . '&after=</div>') ?> | |
</div><!-- .entry-content --> | |
</div> | |
<?php endif; ?> | |
</div><!-- #post --> | |
<?php | |
// action hook for insterting content below #post | |
thematic_belowpost(); | |
//comments_template(); | |
if ( $count == thematic_get_theme_opt( 'index_insert' ) ) { | |
get_sidebar('index-insert'); | |
} | |
$count = $count + 1; | |
endwhile; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment