ThemeShaper Forums » Thematic

[closed]

Excerpts on Static Hompage

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

Tags:

  1. lance1572
    Member

    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 '" ';
    					if (!(THEMATIC_COMPATIBLE_POST_CLASS)) {
    						post_class();
    						echo '>';
    					} else {
    						echo 'class="';
    						thematic_post_class();
    						echo '">';
    					}
         				thematic_postheader();
    										 ?>
    					<div class="entry-content ">
    
    					<?php the_excerpt(); 
    
    					?>
    					</div><!-- .entry-content -->
    
    				</div>
    		<?php endwhile; ?>
    	</div>
    <?php
    	}
    }
    add_action('thematic_belowcontent', 'homepagepost_div');
    
    // CONTROL THE EXCERPT LENGTH
    
    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!!!

    Lance

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

    http://wordpress.org/extend/plugins/the-excerpt-re-reloaded/

    or

    http://www.semiologic.com/software/fancy-excerpt/

    or my own effort on the subject:
    http://forums.themeshaper.com/topic/how-to-make-excerpts-roll-over-and-say-uncle

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.