/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php //showing welcome post (post id =1) // retrieve one post with an ID of 5 query_posts( 'p=1' ); function new_excerpt_length($length) { return 28; } add_filter('excerpt_length', 'new_excerpt_length'); function new_excerpt_more($more) { global $post; return '<a href="'. get_permalink($post->ID) . '"> <br />read more....</a>'; } add_filter('excerpt_more', 'new_excerpt_more'); // set $more to 0 in order to only get the first part of the post global $more; $more = 0; // the Loop while (have_posts()) : the_post(); the_excerpt(); endwhile; ?>
URL: http://deepakrajpal.com/?p=134