ThemeShaper Forums » Thematic


Excerpts on Static Hompage

(2 posts)
  • Started 9 years ago by lance1572
  • Latest reply from helgatheviking
  • This topic is not resolved


  1. lance1572

    Trying to find a solution to this. Havent found any so far. Here is what I have. I have a static homepage that shows one recent excerpt of a post. This works.

    Problem is that it strips out any formatting I have in the post. Anyone have any ideas? It seems to output the excerpt in a p tag. Right below is the excerpt.

    "U.S. Remains Underweight Relative to Other Developed Markets Published in All-Country Equity Allocator, December 2011 On the negative side, the U.S. market is modestly expensive Read Full Report…"

    "U.S. Remains Underweight Relative to Other Developed Markets" should be a h2 tag that wrote in the editor but it's not outputting that.

    function homepagepost_div() {
    	if (is_front_page()) {?> // ONLY ON HOMEPAGE
    	<div id="homepagepost">
    		<?php query_posts('showposts=1'); ?>
    		<?php while (have_posts()): the_post(); ?>
    		<div id="post-<?php the_ID();
    					echo '" ';
    						echo '>';
    					} else {
    						echo 'class="';
    						echo '">';
    					<div class="entry-content ">
    					<?php the_excerpt(); 
    					</div><!-- .entry-content -->
    		<?php endwhile; ?>
    add_action('thematic_belowcontent', 'homepagepost_div');
    function custom_excerpt_length( $length ) {
    	return 25;
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    Are there any filters i could use for the excerpt. Anyone who could help I would appreciate it!!!!! thank you!!!


    Posted 9 years ago #
  2. that's just how the_excerpt() works, it always strips formatting. you can try something like


    or my own effort on the subject:

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.