More tag, get content with formatting: text wrap @ image
-
Simple problem, I’ve seen three forum threads about this, but nothing that goes withthe basic codex w/o core hacks. Here’s the problem:
I have a post, and in the post, BEFORE the MORE tag, there is an image, and 6 lines of text of the post wraps around the image which is floating left.I have the following code getting the picture and the first 6 lines, but no formatting, the text does NOT wrap around the image, which looks, well everybody knows how that looks.
<?php global $post; $args = array( 'numberposts' => 1, 'offset'=> 0, 'category' => 6 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><?php echo apply_filters('the_content', _get_short_info($post->post_content)); ?></p> <?php endforeach; ?>
Can anyone tell me what I need in that code that will get the formatting as well so the text wraps as well. BTW, I have this in the functions.php which defines the “_get_short_info” (not native to WP)
function _get_short_info( $text ){ $t = explode('<!--more-->', $text); return $t[0]; }
thanks,
JSC
- The topic ‘More tag, get content with formatting: text wrap @ image’ is closed to new replies.