how to serve adsense code that can be edited globally (2 posts)

  1. sallam
    Posted 6 years ago #

    I used to add my adsense code in post and page templates. But later on, I found that if I needed to change ad types or colors, I have to edit all the old posts and pages.

    Is there a way to save the code in a css attribute, or some global file, then just add a shortcode or something in the post template?

    Many thanks.

  2. iridiax
    Posted 6 years ago #

    I put mine in a file (myads.php) in my theme's folder and then include it into my theme files.


    An Adsense plugin is also an option as you would just enter your code in the plugin dashboard page.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.