JavaScript appears to be disabled. We recommend you enable JavaScript while visiting this site.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

More comments in WordPress 2.1.2

I noticed the other day that after upgrading to WordPress 2.1.2, many of the ads that the AdSense-Deluxe plugin was adding were not getting really getting added.

Normally I add the necessary AdSense-Deluxe (ASD) code immediately after the 'more' comment. However, if I changed the location of the ASD code, the ads displayed correctly. Eh?

Here's what I did:

Open /wp-includes/post-template.php and change line 83 from:

if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) {

to:

if ( preg_match('/<!--more-->/', $content, $matches) ) {

For whatever reason, it replaces any one comment immediately after the more comment. Since the more comment should be entered in that format ...

Tags:

Categories: software

blog comments powered by Disqus