Support » Fixing WordPress » adsense integration in author bio

  • this is my second post of this question, please don’t hate me for the repost.

    My site is being setup for multiple authors. Each author has their own adsense account and is allowed to post their own ads with their posts. To streamline this process (for both them and me) i would like to place their ad code in the author bio section of each authors profile. This way their ads would be automatically attached to every post they make. The problem I’m having is that wordpress clears the authors bio when I add the script to it. Does anyone know how to get around this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, it sounds to me like you should add a new custom field to an Authors profile to store the code you want. My suggestion is to have a look at Adding and Using Custom User Profile Fields.

    I do this to save user’s amazon affiliate tags and it sounds like it will work for your desired adsense functionality.

    Thank you so much!!

    Did this work for you, otectom? I’m looking to do something similar.

    Okay. I know this thread is pretty much dead, but I found it pretty hard to find info on how to do this, so here’s how it’s done. Hopefully it will help anyone else who needs it.

    First, paste this into functions.php:

    [code moderated – please follow the forum guidelines for posting code]

    Then paste your Adsense code into the neccessary text boxes on your profile page in WP.

    Then paste <?php the_author_meta( ‘adsense1’ ); ?> or <?php the_author_meta( ‘adsense2’ ); ?> where ever you want the ads to appear.

    It’s actually not as hard as WordPress makes it. I would happily turn this into a widget if I knew how. Maybe someone else here can do it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘adsense integration in author bio’ is closed to new replies.