Support » Fixing WordPress » New Update broke javascript (Google Ads not Showing Up)

  • all my posts which contain a Google Ads code and codes for linky ups from Inlinkz, which are javascript are not showing up. Is there an easy fix besides removing >// <![CDATA[ and […// ]]> from EVERY SINGLE CODE in the post?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could use a shortcode to insert ads instead of inserting the JavaScript in the text mode.

    Something like this would make a shortcode ( you could add this to your functions.php file ) :

    function do_my_adsense() {
    	ob_start();
    	?>
    		JavaScript code for Google Ads goes here
    	<?php
    	return ob_get_clean()
    }
    add_shortcode('my-ggl-ad', 'do_my_adsense');

    And use [my-ggl-ad] to output ads, OR, use ready plugins like <a href=”https://wordpress.org/plugins/insert-post-ads/
    “>Post adverts or Insert HTML snippet..

    Let us know how it goes 🙂

    Thread Starter thereviewwire

    (@thereviewwire)

    Thanks, but I don’t understand. I have over 3000 posts that are all broken because of this update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘New Update broke javascript (Google Ads not Showing Up)’ is closed to new replies.