WordPress.org

Ready to get started?Download WordPress

Forums

Easy AdSense
[resolved] Mid-Post Ad template bug fix with Pro? (6 posts)

  1. bigballer
    Member
    Posted 1 year ago #

    Hello, my mid-post ad shows at the top of the content, just under the top ad. I believe my template to be the cause, as it breaks other ad plugins mid-post placements also. Could purchasing the Pro version solve this?

    http://wordpress.org/extend/plugins/easy-adsense-lite/

  2. manojtd
    Member
    Plugin Author

    Posted 1 year ago #

    I don't think the Pro version will fix it. If you post your blog URL, I can take a look and try to figure out what is causing it.

  3. bigballer
    Member
    Posted 1 year ago #

    http://demilovatotattoos.com/rock-and-roll

    is an example of a page affected. I have placed a link unit in the mid-post section to give you an example.

    Thanks! if you can figure it out I will certainly upgrade to pro regardless, and donate a little extra.

  4. manojtd
    Member
    Plugin Author

    Posted 1 year ago #

    I looked at your page, and I think I know what's going on.

    My plugin counts the paragraph markers (<p> tags) to determine an appropriate place to insert the mid-text ad, which would be between two paragraphs near the middle of the post. On your post though, it looks like the <p> tags are being stripped off either by your theme or a plugin, and reinserted before generating the final output. So my plugin doesn't see any paragraphs, and concludes that half the total number of paragraphs is zero, which is near the top.

    The only option I can think of is to insert the mid-text ad based on the number of words or characters. But I think it will look ugly, because it might break a line or a word to put the ad in between.

  5. dorf
    Member
    Posted 1 year ago #

    A slightly better, but still imperfect solution, is to look for return lines.

    Thus I modified easy-adsense-lite.php line 492
    from:

    if(strpos($content, "<p") === false)
    $repchar = "<br;

    to:

    if(strpos($content, "<p") === false)
    $repchar = "\r\n";

  6. dorf
    Member
    Posted 1 year ago #


    if(strpos($content, "<p") === false)
    $repchar = "<br";

    I missed the quote after the <br

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.