WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. juniorcitizen
    Member
    Posted 9 months 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 9 months ago #

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

  3. esmi
    Forum Moderator
    Posted 9 months ago #

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

  4. Wastabik
    Member
    Posted 9 months ago #

    Thanks esmi.

  5. Wastabik
    Member
    Posted 9 months 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 9 months ago #

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

  7. juniorcitizen
    Member
    Posted 9 months ago #

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

  8. infagalaxo
    Member
    Posted 8 months 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 8 months 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 8 months 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 8 months ago #

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

  12. tohokuto
    Member
    Posted 7 months 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 months 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 months ago #

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

Reply

You must log in to post.

About this Theme

About this Topic