Viewing 1 replies (of 1 total)
  • I can’t think of an elegant way to make this work with the PHP Code Widget plugin. You could recreate what you’re looking for using Ad Blocking Detector’s CSS and JavaScript targeting tools. You’d need to output a wrapper around the random advertisement in your PHP widget, then separately output the text with another wrapper, then add in CSS or JavaScript to selectively hide or display the appropriate content.

    However, if you’re willing to use a different PHP plugin, this is very easy to do without all those wrappers and JavaScript/CSS. Basically, you need a plugin that generates a shortcode with PHP in it rather than a widget. Ad Blocking Detector parses shortcodes put into its fields. So, something like Shortcode Exec PHP will work beautifully (I just tested it to verify).

    You create a PHP shortcode in that plugin, or one of the others in the plugin repository, then feed that shortcode into the No Ad Blocker field of Ad Blocking Detector, and your text in the Ad Blocker field. Then, use Ad Blocking Detector’s sidebar widget to display the Ad Blocking Detector shortcode you create.

    Hope this helped!

Viewing 1 replies (of 1 total)

The topic ‘Tips on how to parse PHP code in Ad Blocking Widget?’ is closed to new replies.