Johan
Many thanks for all your efforts.
I'm still using your great plugin for other things, but for this one-off (a promo block on the home page) I created a custom post type called homepromo and wrote a short include to call it. An additional complication that may have caused another issue with your function is that I needed the image in the CSS background.
This is the content of my include file in case it is of use to anyone else - themename-homepromo.php:
<?php if( is_front_page() ) { ?>
<?php
$args = array( 'post_type' => 'homepromo' , 'posts_per_page' => 1 );
$homepromoloop = new WP_Query( $args );
?>
<?php if ( $homepromoloop->have_posts() ) { ?>
<?php while ( $homepromoloop ->have_posts() ) : $homepromoloop ->the_post(); ?>
<?php
$featured_image_id = get_post_thumbnail_id( $post->ID );
$imgArray = wp_get_attachment_image_src($featured_image_id,'home_promo');
$imgsrc = $imgArray[0];
?>
<div id="promo" style="background-image:url(<?php echo($imgsrc); ?>);">
<div id="promotext">
<div id="promotextwrapper">
<?php // the_title() NOT USED; ?>
<?php the_content(); ?>
</div><!-- #promotextwrapper -->
</div><!-- #promotext -->
</div><!-- #promo -->
<?php endwhile; ?>
<?php } else echo(''); ?>
<?php } // end is front page ?>
I called it into the index.php with:
<?php get_template_part( "themename", "homepromo" ) ?>
Martin