Hi there
Im fairly new to php and am having a majotr headache trying to get is_home() working on this function...i have read through tutorials and have tried implimenting it numerous way but always seem to end up with the white screen of death!
Here is the funtion:
function featured_posts(){
$my_query = new WP_Query('tag=featured&showposts=2');
echo '<div id="featured-posts">';
$feat_class = array();
while ($my_query->have_posts()) : $my_query->the_post();
$feat_class = array();
// Category for the post queried
foreach ( (array) get_the_category() as $cat )
$feat_class[] = 'category-' . $cat->slug;
$feat_class = join(" ", $feat_class);
?>
<div id="featured-<?php the_ID(); ?>" class="<?php echo $feat_class; ?>">
<?php
$posttitle = '<h4><a href="';
$posttitle .= get_permalink();
$posttitle .= '" title="';
$posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
$posttitle .= '" rel="bookmark">';
$posttitle .= get_the_title();
$posttitle .= "</h4>\n";
echo $posttitle;
get_the_image();
the_excerpt();
?>
</div><!-- .post -->
<?php
endwhile;
echo '</div>';
}
add_action('thematic_above_indexloop','featured_posts');
Could someone point me in the right direction?
Thank you for any help!
Mogito