Viewing 4 replies - 1 through 4 (of 4 total)
  • Try something like:

    <?php $c = 0;
    if (have_posts()) :  while (have_posts()) : the_post(); $c ++;?>
    
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <?php if( $c ==1 ) : ?>
    <img src="<?php bloginfo('template_directory'); ?>/images/my-image.jpg" width="xx" height="yy" alt="<?php the_title(); ?>" />
    <?php else :?>
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <?php the_time('F jS, Y') ?>
    <?php endif;?>
    Thread Starter RealEmotionX

    (@realemotionx)

    I tried putting this in, but the PHP freaks out.

    Suggestions?

    <?php get_header(); ?>
    
    <div id="content">
    	<div class="postgroup">
    
    <?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<div class="title">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<p>
    					<span class="date"><?php the_time('F j, Y'); ?></span>
    					<span class="divider">&bull;</span>
    					<span class="categories"><?php the_category(', ') ?></span>
    					<span class="divider">&bull;</span>
    					<span class="comments"><?php comments_popup_link('Comments', 'Comments', 'Comments'); ?></span>
    				</p>
    			</div>
    			<div class="entry">
    				<?php the_content('[View Show Notes]'); ?>
    			</div>
    		</div>
    
    	<?php endwhile; ?>
    
    	<div id="pagenav"><!-- <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else { posts_nav_link(); } ?>--></div>
    
    <?php else : ?>
    
    		<div class="post">
    			<div class="title">
    				<h2>No Archive Found</h2>
    			</div>
    			<div class="entry">
    				<p>Sorry, but you are looking for an archive that isn't here.</p>
    			</div>
    		</div>
    
    <?php endif; ?>
    
    	</div>
    </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thread Starter RealEmotionX

    (@realemotionx)

    Bingo. Did the trick. Thanks for the help! 😀

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Replace Post header on first post’ is closed to new replies.