Jump to content


Photo
- - - - -

How to use content sidebar for asdsense


  • Please log in to reply
8 replies to this topic

#1 philippez

philippez

    Member

  • Members
  • 15 posts

Posted 21 November 2011 - 08:04 PM

Hi, I don't want to use plugins but I would prefer to use a content sidebar for my adsense ads(align right). I would like to put 250x250 ads in all of my blog post. can someone give the best css code for what I am trying to do? Again I don't want to do it with plugins but with the products within pagelines. I want it to be align right. thanks

#2 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 21 November 2011 - 10:38 PM

Can you activate your ads in the sidebar and post a link to your site? There are too many specific classes or id's at play that are needed to make the code work. I know you said you didn't want to use plugins, but WP125 is super easy and nice, and you'll be set up in minutes.

#3 philippez

philippez

    Member

  • Members
  • 15 posts

Posted 22 November 2011 - 02:10 AM

Hi thanks but I would like to have the ads in the content area like this site :

Please Login or Register to see this Hidden Content



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 16526 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 22 November 2011 - 08:12 AM

Hi Philippe, I don't see any adds on the link you provided.

#5 philippez

philippez

    Member

  • Members
  • 15 posts

Posted 26 November 2011 - 12:34 AM

They are adsense blocks in the content area.

#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 26 November 2011 - 12:39 AM

That's a customization of the post with the ad aligned right. A content sidebar would not really apply. You can also add code directly to the post when you write it, making sure the alignment is set to the right. I'm not sure how comfortable you are with coding, but effectively, you could edit the template.content.php or template.postloop.php files and place the ad there. Each time you create a page, the ad would be built in. Are you familiar with editing the template files?

#7 profoundtigger

profoundtigger

    Super Member

  • Members
  • PipPipPipPip
  • 108 posts
  • Country: Country Flag

Posted 26 November 2011 - 01:24 AM

I have something similar. Trying using this hook. Put this on functions.php add_action('Pagelines_inside_top_maincontent', 'Adsense'); function Adsense(){ ?>
PUT YOUR ADSENSE CODE HERE

#8 philippez

philippez

    Member

  • Members
  • 15 posts

Posted 26 November 2011 - 01:48 AM

Thanks both of you, both answers are awesome.

#9 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 26 November 2011 - 10:41 PM

No problem!