WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sallam
    Member
    Posted 4 years ago #

    Greetings
    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
    Member
    Posted 4 years ago #

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

    http://codex.wordpress.org/Include_Tags#Including_Any_Template

    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

Tags

No tags yet.