Wordpress First Post Full Rest Excerpt

Hello, I want to have only latest post show un full and rest in excerpt. I have attached the code of the file that shows posts in home page.

I've tried to apply codes from the web without success.

Note: currently it is showing all posts in equal format. I only need the first one in full and the rest just an extract.

Thanks in advanced.
code.txt
suplyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jrm213jrm213Commented:
Try replacing that code with something like this
 <div class="singlePost">
                    <?php 
$postCount = 0;
if(have_posts()) : while(have_posts()) : the_post('');
$postCount++;
?>
                   
                    	<div class="article">
                        	<div class="articleDetails">
                            	<div class="articleTitle">
                                     <a href="<?php the_permalink();?>"><h1><?php the_title(); ?></h1></a>
                                </div><!--End articleTitle-->
                                <div class="articleMeta">
                                   <ul>
                                        <li class="postAuthor"><?php the_author(); ?></li>
                                        <li class="postDate"><?php the_time('d M Y'); ?></li>
                                        <li class="postCat"><?php the_category(', ') ?></li>
                                        <li class="postComments"><?php comments_popup_link(__('<span class="icon"></span> 0 Comments', 'lioit'), __('<span class="icon"></span> 1 Comment', 'lioit'), __('<span class="icon"></span> % Comments', 'lioit')); ?></li>
                                       
                                    </ul><!--End Post Meta-->
                                    
                                </div><!--End articleMeta-->
                            </div><!--End Article Details-->
                            <div class="articleContent">
                            	<div class="articlePostThumb">
                                     <?php $img = catch_that_image($post->ID); ?>
                                    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
                                    <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=200&amp;h=150&amp;zc=1" alt="<?php the_title(); ?>" />
                                    </a>
                                </div><!--End LatestPostThumb-->
                            	<p><?php 
if($postCount > 1){
                  the_excerpt_max_charlength(''); 
                  echo(" ...");
}
else
{
    the_content();
}

?></p>
                            </div><!--End ArticleContent-->
                            <div class="articleBtm">
                            	<?php require Lioit_TM . '/share.php';?>
                                <div class="articleReadMore">
                                	<a href="<?php the_permalink();?>"><?php _e('Read More' , 'lioit' ) ?></a>
                                </div><!--End More-->
                            </div><!--End Article Bottom-->
                        </div><!--End article-->
                        <?php endwhile; ?>
						<?php  else:  ?>
                        <?php  endif; ?>
                        <?php lio_pagination(); ?>
                         </div>

Open in new window


so basically outside "The Loop" we set the postCount to 0; Inside the loop for each iteration the postCount variable is incremented and that value is checked before displaying the post excerpt or content. If it is <= 1 then display the full post content, if it is > 1 then display the excerpt content.
0
suplyAuthor Commented:
Hello jrm213jrm213, thanks. I used it and it's almost perfect. Please see the attached image. As you can see, there are two images. I'd need only the big one.

Also, is it possible to remove the read more button only for the lastest post?

Regards.
JC.
img.PNG
0
suplyAuthor Commented:
I managed to delete the thumb image left side. Latest full post is OK but I'd like to have other post to show their big image

Is this possible?

Thanks.
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

jrm213jrm213Commented:
Yes, we just need to move the "if" statement around a little bit to incorporate some more of the code.


This should get rid of the read more link for the first post, as for the image I am not sure. It looks like it is using some custom functionality that was built into your theme "Lioit".

 <div class="singlePost">
                    <?php 
$postCount = 0;
if(have_posts()) : while(have_posts()) : the_post('');
$postCount++;
?>
                   
                    	<div class="article">
                        	<div class="articleDetails">
                            	<div class="articleTitle">
                                     <a href="<?php the_permalink();?>"><h1><?php the_title(); ?></h1></a>
                                </div><!--End articleTitle-->
                                <div class="articleMeta">
                                   <ul>
                                        <li class="postAuthor"><?php the_author(); ?></li>
                                        <li class="postDate"><?php the_time('d M Y'); ?></li>
                                        <li class="postCat"><?php the_category(', ') ?></li>
                                        <li class="postComments"><?php comments_popup_link(__('<span class="icon"></span> 0 Comments', 'lioit'), __('<span class="icon"></span> 1 Comment', 'lioit'), __('<span class="icon"></span> % Comments', 'lioit')); ?></li>
                                       
                                    </ul><!--End Post Meta-->
                                    
                                </div><!--End articleMeta-->
                            </div><!--End Article Details-->
                            <div class="articleContent">
                            	<div class="articlePostThumb">
                                     <?php $img = catch_that_image($post->ID); ?>
                                    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
                                    <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=200&amp;h=150&amp;zc=1" alt="<?php the_title(); ?>" />
                                    </a>
                                </div><!--End LatestPostThumb-->
                            	<p><?php 
if($postCount > 1){
                  the_excerpt_max_charlength(''); 
                  echo(" ...");
}
else
{
    the_content();
}

?></p>
                            </div><!--End ArticleContent-->
<?php
if($postCount > 1){
?>
                            <div class="articleBtm">
                            	<?php require Lioit_TM . '/share.php';?>
                                <div class="articleReadMore">
                                	<a href="<?php the_permalink();?>"><?php _e('Read More' , 'lioit' ) ?></a>
                                </div><!--End More-->
                            </div><!--End Article Bottom-->
<?php } ?> 
                        </div><!--End article-->
                        <?php endwhile; ?>
						<?php  else:  ?>
                        <?php  endif; ?>
                        <?php lio_pagination(); ?>
                         </div>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
suplyAuthor Commented:
jrm213jrm213, we're almost done thanks once again. Read more is gone, latest post big image is showing, I managed to remove the thumb, but for the rest of the posts is it possible to have and post image as the one that's currently as latest post?

I'm attaching a screen shot
img.PNG
0
jrm213jrm213Commented:
I am unfamiliar with the function "catch_that_image" that is being called to retrieve the post image. I am guessing it comes from a plugin or is built into your custom theme.

Nothing in the code is excluding the "non-first" posts from having an image displayed so it must be something in that function. Could you post the code that you are currently using that you modified to not display the thumbnail?

If you have a featured image set for the page you can use the function the_post_thumbnail to display it

http://codex.wordpress.org/Function_Reference/the_post_thumbnail
0
suplyAuthor Commented:
Thanks!
0
suplyAuthor Commented:
jrm213jrm213

Is it possible that when you click page 2 the first post doesn't show full?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.