[wp-trac] [WordPress Trac] #12536: get_the_content does not properly trim split post (read more link)

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 6 23:56:38 UTC 2010


#12536: get_the_content does not properly trim split post (read more link)
--------------------------+-------------------------------------------------
 Reporter:  Ateo          |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  high          |   Milestone:  Unassigned
Component:  Formatting    |     Version:  2.9.2     
 Severity:  minor         |    Keywords:            
--------------------------+-------------------------------------------------
 When you utilize <!--more--> in a post to effectively add a 'read more'
 link the end to the end of the post linking to the full article (on home
 page stream), the function fails to trim the chunk to be displayed leaving
 the trailing new line maker (\n) thus when default filter ''wpautop'' is
 applied, it naturally converts that trailing maker into a br tag, as it
 should.

 This affects formatting/placement of the 'read more' link. I personally
 want my 'read more' link immediately following my text. This isn't
 possible without trimming the chunk of text. As such, the 'read more' link
 is bumped to the next line down. =(

 Anyways, the fix is super super easy! I swear.

 File: wp-includes/post-template.php[[BR]]
 Line: 217[[BR]]
 AFTER ADD:

 $output = trim($output);

 This is from WP version 2.9.2. Not sure in which version this became
 apparent, if not always.

 Thanks!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12536>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list