• Resolved FS

    (@fedsmith)


    I’m running into an issue where ad code I define inside of the plugin to go into various places inside of the post body (after certain paragraphs, at the end of the content, etc) is getting added to one of the widgets on my site. It only happens on individual post pages (i.e. is_single() ). The widget in question produces an email sign up form, so it has an HTML form with checkboxes, a submit button, etc. My guess is the Insert Post Ads widget sees the HTML in it as part of the post body itself.

    Is there a quick fix or workaround for this?

    Other than this one problem I think the plugin is great!

Viewing 1 replies (of 1 total)
  • Thread Starter FS

    (@fedsmith)

    Update:
    I was able to come up with a fix for this. I used the plugin’s filter insert_post_ads_enabled to turn the plugin off for my site’s sidebar and figured out where to hook into the sidebar rendering to have it activate accordingly.

    Here’s the code in case it helps anybody else:

    function remove_sidebar_ad_code( ) {
    	add_filter( 'insert_post_ads_enabled', '__return_false' ); // disable insert ads plugin by setting relevant filter to false
    }
    add_action( 'dynamic_sidebar_before', 'remove_sidebar_ad_code', 10, 2 ); 
Viewing 1 replies (of 1 total)
  • The topic ‘Ad code being added to widgets’ is closed to new replies.