• Resolved shwaza

    (@shwaza)


    Hi, I’m trying to put some ads right after the <!–more–> tag on a single and I’m wondering how I could do that. Anyone have any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try adding this to your theme’s functions.php file:

    function Shwaza_ads($content) {
    $my_ads = '
    here
    is
    my
    ad
    ';
    return preg_replace('#(<a id="more-[^>]*></a>)#',"$1 $my_ads",$content,1);
    }
    add_filter('the_content','Shwaza_ads');

    Thread Starter shwaza

    (@shwaza)

    Alright, thanks :). That was what I was going to do, but I figured there was a “cleaner” way to do it.

    Thanks a lot ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Putting Something After <!–more–>’ is closed to new replies.