That’s pretty messy. Let’s try something easy to make sure it works first:
<?php
$recent = new WP_Query('post_type=outtakes&posts_per_page=5' );
while( $recent->have_posts() ) : $recent->the_post();
if ( $is_first_post && has_post_thumbnail() ) {
the_post_thumbnail('medium'); echo excerpt(25);
} else {
the_title();
}
endwhile;
?>
I just tried that and it just gives me the first post excerpt with no image, title and no link to read more. It also is not putting out the other 4 items.
Thank you
Oops.. that’s my mistake. I was taking some of your code from the original that you posted.
Change this:
if ( $is_first_post && has_post_thumbnail() ) {
To this:
if ( is_first_post() && has_post_thumbnail() ) {
I used the below code and now I get an error
Fatal error: Call to undefined function is_first_post() in /home/XXXXXX/public_html/wp-content/themes/XXXXXX/myhomepage.php on line 46
Thank you
/<?php
$recent = new WP_Query(‘post_type=outtakes&posts_per_page=5’ );
while( $recent->have_posts() ) : $recent->the_post();
if ( is_first_post() && has_post_thumbnail() ) {
the_post_thumbnail(‘medium’); echo excerpt(25);
} else {
the_title();
}
endwhile;
?>/
[please read and apply the forum guidelines for posting code – http://codex.wordpress.org/Forum_Welcome#Posting_Code ]
Can you try it with this:
<?php
$recent = new WP_Query( 'post_type=outtakes&posts_per_page=5' );
while ( $recent->have_posts() ) : $recent->the_post();
if ( $recent->current_post == 0 ) {
if ( has_post_thumbnail() ) {
the_post_thumbnail( 'medium' );
}
echo excerpt( 25 );
} else {
the_title();
}
endwhile;
?>
is excerpt(25) a function in your theme?
Getting closer. It is showing the first image and excerpt but the title is not clickable and their is now More>> at the end of the excerpt.
The rest ot the titles are coming in but they are right next to each other not an unordered list and are not clickable.
Thank you for you help.
/
<?php
$recent = new WP_Query( ‘post_type=outtakes&posts_per_page=5’ );
while ( $recent->have_posts() ) : $recent->the_post();
if ( $recent->current_post == 0 ) {
if ( has_post_thumbnail() ) {
the_post_thumbnail( ‘medium’ );
}
echo the_title(); echo excerpt( 25 );
} else {
echo the_title();
}
endwhile;
?>/
I also found another code that is almost working but this one is not removing the excerpt from the rest of the items.
/
<?php $c = 0; $blog_query = new WP_Query(‘post_type=outtakes&posts_per_page=5’);
while ($blog_query->have_posts()) : $blog_query->the_post();?>
<div <?php if( $c ==0 ) post_class(‘special’); else post_class() ?> id=”post-<?php the_ID(); ?>”>
<?php if ( has_post_thumbnail()) : ?>
” title=”<?php the_title_attribute(); ?>” >
<?php the_post_thumbnail(‘medium’); ?>
<?php endif; ?>
<h3>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h3>
<?php the_excerpt() ?>
</div><!–post–>
<?php $c++;?>
<?php endwhile; ?>
/
So far the code that seams to work the best is the one I was using at first but by two issues I am having with it still is that the image is not permalink so I can’t click on it and the Title is not above the excerpt it is below it and if I put it above the excert that title still shows in the bullet list.
Any help on this would be appreseated.
Thank you
/<?php $recent = new WP_Query(‘post_type=outtakes&posts_per_page=3’ ); ?>
<?php $is_first_post = true; ?>
<?php while( $recent->have_posts() ) : $recent->the_post(); ?>
<?php
if ( $is_first_post && has_post_thumbnail() ) {
the_post_thumbnail(‘medium’); echo excerpt(25);
$is_first_post = false;
}
?>
<?php endwhile; ?>/