manual excerpt help
-
Hi there,
im developing a bespoke WordPress theme for the first time & im having difficulties getting the manual excerpt working correctly.I have this in my functions.php:
//Get the excert function for limiting the length of the words of the front homepage news boxes function get_excerpt($count){ $permalink = get_permalink($post->ID); $excerpt = get_the_content(); $excerpt = strip_tags($excerpt); $excerpt = substr($excerpt, 0, $count); $excerpt = substr($excerpt, 0, strripos($excerpt, " ")); $excerpt = $excerpt.'<a href="'.$permalink.'">....</a>'; return $excerpt; }
This is what i have on my blog page
<h2><a class="blogposttitle" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <span class="meta"><?php the_time('F jS, Y'); ?> / Posted by <?php the_author_link(); ?> / <span class="comments"> <?php comments_popup_link(__('0 comments','example'),__('1 comment','example'),__('% comments','example')); ?></span></span> <div class="dots"></div> <br><p><img src="<?php bloginfo('url'); ?>/imgresize.php?src=<?php echo $image_attributes[0]; ?>&h=200&w=800&q=100"></p> <?php echo get_excerpt(800); ?> </div><!-- /#post-<?php get_the_ID(); ?> --> <?php endwhile; ?>
When i add a manual excerpt it just shows the standard text from the post & not what has been entered in the manual excerpt field. Is there anything i am missing?
Thank you
- The topic ‘manual excerpt help’ is closed to new replies.