How to Place Your Ads Inside the Post of Thesis Theme?

Thesis theme is easy to use and we can customize the theme as our wish. Due to inbuilt of SEO optimization thesis users are increasing rapidly. If you are thesis users, this tutorial will helpful to display your Ads in your site. The Ads can be displayed header, footer, sidebar and inside of the post. In previous tutorial I explained about widgetized header, and widgetized footer. Now in this tutorial I explain about how to show your ads wigetized inside the post of thesis theme.

In this below video I explain the procedure.


How to show your Ads box inside the post of thesis theme?

To show your ads inside of the post follow this step below.

Add the below code into custom_function.php

/***BUILD AD WIDGET INSIDE POST paste in custom_functiom.php***/
register_sidebars(1,
array(
'name' => 'Post_AD',
'before_widget' => '<li id="%1$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>' )
);

function post_ad_widget() { ?>
<div id="post_ad">
<ul>
<?php thesis_default_widget(4); ?>
</ul>
</div>
<?php }
add_action('thesis_hook_after_post', 'post_ad_widget', '1');
/***POST AD WIDGET END***/

Add the below code into custom.css

/* CODE FOR CUSTOM.CSS FILE*/

.custom #post_ad ul.sidebar_list li.widget h3 {text-indent:0; padding-top:0.2em; color:#111; font-size:22px; font-family:georgia; background:none;}
.custom #post_ad ul.sidebar_list li.widget ul { }
  • After adding this code, go to Appearnace select widgets.
  • In the left side now you will see a new widget in the name of  Post_Ad.
  • Next, drag and drop the text widget from centre panel to post_Ad.
  • Give the title, copy and paste the Advertisement code here. Then, click saves.
  • Now refresh your site you will see the Ads inside of the post.

I hope this post will helpful to you. Do you have any question post in comment section below?. For more checkout our all Thesis theme tutorials..

{ 56 comments… add one }

Leave a Comment

  • aviationMY January 10, 2010, 2:54 PM

    hi, its me once again.

    im already subscribing to you via email but when i wanna subscribe via RSS..i clicked on the RSS icon and got this message:

    Feed Address: http://feeds.feedburner.com/fourblogger

    HTTP Error (Code) and Message: (404) Feed not found error: FeedBurner cannot locate this feed URI.

    ***Pascal please fix this ASAP.

    keep up the good work..FourBlogger.com is the best Thesis Customization blog in the World!

    Reply
    • Pascal January 10, 2010, 3:26 PM

      Thanks aviation.. Now you can subscribe via RSS.

      You can also subscribe to our youtube channel so that you won’t miss any tutorial.

      Reply
      • aviationMY January 11, 2010, 9:48 PM

        /* testing multiple background */

        body {
        background-image: url(http://domain.com/wp-content/uploads/test.png);
        background-attachment: fixed;
        background-position: top left;
        background-repeat: no-repeat;
        }

        hi, its me once again.

        how could possible for CSS to put multiple image for background…like at the above code..i wanna it on top right because i want to images in my background…i search for it and people said to put html but it wont work at all…hope you can help me.

        and..how to make the vertical line between content and sidebar more wider in Thesis theme..i want the border but a little bit wider.

        Reply
        • Pascal January 12, 2010, 9:47 AM

          It is possible to add multiple background image within the body section.
          For this query, we will post soon..

          Reply
      • aviationMY January 18, 2010, 3:11 PM

        how about ads in front page and other pages before the post title? its like welcome box so we address different ads in different pages.

        Reply
  • shivaraj January 10, 2010, 4:06 PM

    Your team rocks, its amazing,
    thanks for post.

    Reply
    • Pascal January 10, 2010, 6:10 PM

      Thanks Shivaraj.

      Reply
  • Blog tin hoc January 10, 2010, 8:39 PM

    I don’t use Thesis , i using one-theme 2.0 .But I have seen that thesis is “king of SEO” , maybe I’ll try use it on my blog . Thank for nice tip

    Reply
    • Pascal January 11, 2010, 12:10 AM

      Thanks for reading and commenting.

      Reply
  • Amandeep Singh January 11, 2010, 11:58 AM

    Pascal, Can this not be accomplished with Adsense plugin also?

    But, yes i think using this method, one can shed off the load of one plugin 😀

    Can i implement this method to any other theme as well or this is only for thesis?

    Reply
    • Pascal January 11, 2010, 12:10 PM

      This for thesis theme only amandeep

      Reply
  • Mr.Hyd January 18, 2010, 2:25 PM

    Thanks it really helps me lot!!

    Reply
    • Pascal January 18, 2010, 7:25 PM

      Thanks Mr.Hyd.

      Reply
  • picso February 5, 2010, 2:28 PM

    Parse error: syntax error, unexpected ‘}’ in custom_functions.php

    Reply
    • Pascal February 5, 2010, 2:36 PM

      Give your site name, then only we can rectify this error.

      Reply
      • aviationMY February 22, 2010, 10:22 PM

        Hi Pascal,

        long time no comments..

        i love your ads tutorial…

        i just implement it into my website but the POST_AD, its nice with a simple adjustment and a drop of color however, it shows in front page. In another meaning, i want it to show in single page only which is if (is_single()) { but i dont know how to put this line into your code.

        and another thing …the ads box shows a black circle at my left..check out my website..how to get rid of it?

        thank you in advance, im waiting for another tutorial..

        Reply
        • Suresh February 22, 2010, 10:32 PM

          Hai aviationmy,
          you should add if function code after the function name like below code
          function post_ad_widget() {
          if (is_single()) {
          ?>
          enter your function here
          <?php
          }}
          add_action(‘ ‘)

          Reply
          • aviationMY February 22, 2010, 11:13 PM

            hi Suresh, thank you..it works..but how to removed the black dot? there’s a black dot at the left if you can see at my website.

            Reply
            • Suresh February 22, 2010, 11:27 PM

              hai,

              In the custom_functions.php code after the first div ie) div id="post_ad" replace ul with
              ul class="sidebar_list" the dot will be removed

              Reply
          • Fety Ayu January 18, 2011, 12:47 PM

            I don’t really understand this..It make me confuse…I just want to make the add box appeared in single post & not at the homepage…can U just give me the right code……

            Reply
      • nugrinti May 8, 2010, 12:06 PM

        what do you mean by this? I also encounter the same error, please advise.

        Reply
        • Suresh May 8, 2010, 2:53 PM

          hai nugrinti,

          Tell me clearly, what error you are facing?…

          Reply
  • Chris March 3, 2010, 12:35 AM

    Thanks for the post. I was almost going to pay someone to do this for me, but i came across your post, and now i don’t need to spend money and can widgetize some things in thesis

    Reply
    • Suresh March 3, 2010, 9:18 AM

      hai chris,
      You can widgetized any part of thesis theme with help of appropriate hooks…

      Reply
      • Rachel August 28, 2012, 1:50 AM

        So true! You just saved me $59 to pay for plug-ins that widgetize!

        You rock!

        Reply
  • Sam April 18, 2010, 12:42 PM

    I cant find the custom css file. Where is it?

    Reply
    • Suresh April 18, 2010, 9:29 PM

      hai,

      check this path
      login your wordpress admin
      click on custom file editor under thesis options in left sidebar of the wp admin dash board.
      here you have custom.css file.

      or
      by using ftp you can find css file

      the path is
      yourdomain.com/wp-content/themes/thesis/custom/custom.css

      Reply
  • Kevin April 20, 2010, 8:27 PM

    Thanks for your helpful blog. I think I followed your directions, but instead of my Google ads I’m getting a gray box that says… *
    Default Widget

    This is Sidebar 4. You can edit the content that appears here by visiting your Widgets panel and modifying the current widgets in Sidebar 4. Or, if you want to be a true ninja, you can add your own content to this sidebar by using the appropriate hooks.

    I’ve placed the script from Google in the Text widget in Post_AD and saved it.
    Do you have any suggestions?
    Thanks again,
    Kevin

    Reply
    • Suresh April 20, 2010, 9:38 PM

      hai,

      go to your widget panel in appearance section of wp-admin. count the number of widget available from sidebar_1, sidebar_2 like this if you have already 3 widgets before post_AD. it will work. other wise count the number of available before
      post_AD widget if it is two.

      In the above custom_function.php code change thesis_default_widget(4) as thesis_default_widget(3) and save it. your add will appear.

      If you have already 4 change it into 5. This will explained in video….

      Reply
  • Kevin April 20, 2010, 10:12 PM

    Hi Suresh,
    Thank you so much. That was what I needed. It works now.

    Reply
  • Smith May 27, 2010, 11:06 PM

    Hi, can u teach me how can i put widget after post?
    Im so frust now.Please!

    Reply
    • Suresh May 28, 2010, 12:16 AM

      hai smith,

      Follow the instruction give in the above post ..

      which show the way to add widget below post..

      Reply
  • Smith May 29, 2010, 6:18 AM

    Hello. Suresh, can u help to put featured content gallery to my site?
    I want to put at my header.

    Reply
    • Suresh May 29, 2010, 10:47 AM

      hai Smith,

      Install the wp-plugin ‘dynamic content gallery’
      select the options available in the plugin..
      You will get the featured content gallery..

      Reply
  • wilander June 2, 2010, 4:55 PM

    Suresh:

    hi any idea for placing mobile ads inside the post content ; adsense mobile ads
    plz help me the code is
    CGI/Perl v5.8
    JSP v1.2
    ASP v3.0

    Reply
    • Pascal June 3, 2010, 12:48 AM

      Hi you can put the mobile ads as per the Google adsense guidelines as you normally do in case text/image ads….

      Have you pasted the whole code in comment? It looks like only part of the code..

      If you have any links for Google adsense then give me…I will try to let you know how to do it.

      Reply
  • Nedlua June 4, 2010, 4:13 AM

    Allow me to be another person to say this is an awesome and resourceful site

    Reply
  • ant June 10, 2010, 7:32 AM

    hey i am trying to add a widget above each teaser headline….how do you do that?????

    Reply
    • Suresh June 10, 2010, 10:50 AM

      hai ant,

      Use the appropriate hook in custom function.php file. use the below hook..
      thesis_hook_before_teaser_headline
      do you want to know the places where your hook appeared in webpage visit ‘before knowing about hooks’ part in the below tutorial.
      http://fourblogger.com/how-to-use-hooks-in-thesis-theme/

      Reply
  • Amit August 8, 2010, 11:36 PM

    I want to Build something very similar to the blue box on the page linked below.

    http://www.designpublic.com/shop/inhabit/14520

    on my website: http://www.apartmentdesignco.com on all the products page like this

    would I want image or it is a box I can create via css

    Reply
  • Amit August 9, 2010, 12:02 AM

    sorry for previous …The one link was not working …so I am posting another one…

    I want to Build something very similar to the blue box on the page linked below.

    http://www.designpublic.com/shop/inhabit/14520

    on my website: http://www.apartmentdesignco.com on all the products page like this

    http://www.apartmentdesignco.com/2010/apartment-furniture/indigo-slipper-chair

    would I want image or it is a box I can create via css

    Thanks

    Reply
    • Pascal August 9, 2010, 6:48 PM

      Hi amit,

      Our thesis team totally move to our membershipsite fourbloggerclub. so nowadays we are solve any single thesis issue for $5 only. it is ok for you. send your requirements.
      contact us via contact form

      Reply
  • Sanbik October 15, 2010, 10:41 PM

    great tips…

    Reply
  • Fety Ayu January 18, 2011, 7:29 PM

    Hi, how can I add the add widget only at the single post?? Can you share with me the code… I don’t want the add box to appear on homepage of my blog….

    Thanks………..

    Reply
  • paul March 3, 2011, 8:43 AM

    Hi pascal, BTW, thanks for this great tip.
    Just want to ask if how can i move the position of the widget_ad?

    Reply
  • Dave April 17, 2011, 2:08 AM

    I followed your directions exactly, and the Post_Ad widget shows up on my widget panel, and I have placed a text widget into it. However, when I view my site, I see a widget area that has a bullet in front of it, and that says “Default Widget. This is Sidebar 4. You can edit the content that appears here by visiting your Widgets panel and modifying the current widgets in Sidebar 4. Or, if you want to be a true ninja, you can add your own content to this sidebar by using the appropriate hooks.” This is clearly from Thesis.

    I do not see a sidebar 4 on my widgets panel, and the text widget I placed in the Post_Ad widget area is not showing up at all.

    Please advise, and thanks for the excellent tips.

    Dave

    Reply
  • Scott Dudley July 26, 2011, 4:10 PM

    Great post very useful – thanks very much.

    Are you able to make the widget disappear from all pages, and only display on the blog posts themselves. I don’t want the widget to appear on all of my pages, only the posts.

    I know you did mention an if statement above in the comments to do this, but it doesn’t give the exact code to be used for a person that is not a programming expert.

    check out my site at http://ScottDudley.net to see what I mean

    Scott

    Reply
  • Lindarx September 19, 2011, 3:20 PM

    Well First of all thanks for your wonderful tutotials.I just put the code like you said in my site.It shows fine but it also took something that i put on the footer and it’s showing that on my 2 teasers.Any fix.(am using thesis Bold skin)

    Reply
    • Suresh September 20, 2011, 9:05 AM

      hai Lindarx,

      It seems like default widget number problem.. In the above post I used default_widget(4) . Just go to you widgets section in wp-dashboard count the number of widget and use the next number for next widget. If total number of widgets are 5 then for post ad we should use 6. ie default_widget(6)
      Just check this..

      more details on creating widgets http://fourblogger.com/widgetized-thesis-theme-header-content-box-and-footer/

      Reply
  • Lindarx September 20, 2011, 5:30 PM

    Thanks for the info,i found a plugin about the post one.But i surely will try the header widget…..Very nice tutorials,keep it up :D.

    Reply
  • anuraag October 16, 2011, 12:53 AM

    Why post widget appear in Home page also .. I dont want it on home page

    Reply
  • Johnjeo December 3, 2011, 11:01 PM

    can i know how to place ads below the posts

    Reply