WordPress.org

Forums

MesoColumn
[resolved] Ad Settings don't allow script tag (14 posts)

  1. juniorcitizen
    Member
    Posted 2 years ago #

    I am trying to add code for my banner ad exchange into the Advertisement field (Appearance > Theme Options, under Advertisement Settings). However, the ad exchange I am using supplies the code in the script tag (see below); when I add the code into any of the fields and save, the code is stripped out from those fields.

    I can add the code in a Text Widget successfully, so I know it works, but not in the fields for the banner sizes of the theme.

    Code looks like:

    <script type='text/javascript' src='http://xxx'></script>

  2. Wastabik
    Member
    Posted 2 years ago #

    Same problem here. The AdSense codes don't work.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    @Wastabik: If you require assistance then, as per the Forum Welcome, please post your own topic.

  4. Wastabik
    Member
    Posted 2 years ago #

    Thanks esmi.

  5. Wastabik
    Member
    Posted 2 years ago #

    @juniorcitizen, just in case you haven't solved this
    1. Install Shortcoder plugin (recommended by the theme author)
    2. Copy the ad code from your Adsense account, paste it in the blank space in the plugin and generate short code; ex- HeaderAd
    3. In Theme Options, place the short code as [sc:HeaderAd] in the space where you want to add the header ad.
    4. Generate and use short codes for other ads in the same way.

  6. Richie KS
    Member
    Theme Author

    Posted 2 years ago #

    yeap, latest version stripped script code from option value but allow shortcodes.

  7. juniorcitizen
    Member
    Posted 2 years ago #

    Thanks all for your replies. I followed Wastabiks instructions and they worked perfectly; using Shortcodes worked a charm. Many thanks!

  8. Jagabandhu
    Member
    Posted 2 years ago #

    I faced the same problem, now am going to try the plugin.
    He, @Richie can't we make it without using any plugin??

  9. Richie KS
    Member
    Theme Author

    Posted 2 years ago #

    yes but require you to edit the lib/functions/options-functions.php line 534, comment in the line like this
    //$newinput[$k] = wp_filter_post_kses($v);

  10. Frantonia
    Member
    Posted 2 years ago #

    @Richie KS, I have tried using the plugin and shortcode and the ad is still not working.

    Please advise.

  11. Richie KS
    Member
    Theme Author

    Posted 2 years ago #

    make sure your shortcode name is without space like sc:ads400 not sc:ads 400.

  12. tohokuto
    Member
    Posted 2 years ago #

    @Wastabik thank you, that is exactly what I needed.

    Feedback - have this small info (maybe like "script tag not accepted here") to be added to below the dialog box.

  13. nirvine
    Member
    Posted 2 years ago #

    Where do I go to edit this? "edit the lib/functions/options-functions.php line 534"

  14. Richie KS
    Member
    Theme Author

    Posted 2 years ago #

    you can't edit via wp-admin->editor, you need ftp access and manual edit the php file above.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic