AdSense for team blogs and other uses

tttttt
YYY






Using conditional data: post.author

You may have a blog with multiple authors and you want to give them the perfect google income according to their respective articles. This post is helpful to you to distribute your writers the google revenue.

The use of conditional tag to data: post.author allows several uses for blogs with a team of writers. In this article we look at some examples of what can be done. It is important to note that these hacks the author's name must be exactly the same spelling as contained in the profile display name of the author, for example, by placing my name is necessary to write Krish , starting with "K" in capital letters, the letter "ish" in lowercase. If I write KRISH or krish, the hack does not work. It is also important that you stay tuned to the closing of tags b:if that should always match the number of "b:if" you open.


1) Link the name of the author of the post description page or "About" (About me)


Some blogs have team pages describing each author. For the reader knows the author of the best post, you can put your name in a link that points to this page. Or the administrator can use these links to direct the Twitter page of the author of the post, or an individual's blog. To do this, locate the code author of the post (below the line of the post title or footer):


< span class = 'post-author vcard' >
< b: if cond = 'data: top.showAuthor' >
< Date: top.authorLabel />
< span class = 'fn' > < data: post.author />




Add the conditional, as in the example below:

< span class = 'post-author vcard " > 
< b: if cond = 'data: top.showAuthor " > 
< Date: top.authorLabel /> 
< span class = 'fn' > 
< b: if cond = 'data: post.author == "AUTHOR-1'" > 
< a href = ' http://ENDERE -CO-OF-THE-AUTHOR PAGE-1 ' > NAME OF AUTHOR 1 </ a > 
< b: else /> 
< b: if cond = 'data: post.author == "AUTHOR-2'" >
< a href = ' http://ENDERE CO-OF-THE-PAGE-AUTHOR-2 ' > NAME OF THE AUTHOR 2 </ a >
< b: else /> 
< b: if cond = 'data: post.author == "AUTHOR-3'" >
< a href = ' http://ENDERE -CO-OF-THE-AUTHOR PAGE-3 ' > 3 AUTHOR'S NAME </ a > 
< b: else /> 
< b: if cond = 'data: post.author == "AUTHOR-4" " > 
< a href = ' http://ENDERE CO-OF-THE-PAGE-AUTHOR-4 ' > 4 AUTHOR'S NAME </ a > 
< b: else /> 
< Date: post.author /> <! - Administrator for posts ---> 
> </ b: if > </ b: if > </ b: if > </ b: if > 
</ span > 
</ b: if > 
</ span > 






2) Placing an "avatar" with information about the author of the post in the Post Footer
The reasoning is similar, but you should create some classin order to apply styles to the "avatar". Consider the example:



< div class = 'post-footer " > < font > </ font >
< div class = 'post-footer-line post-footer-line-1 " >
< b: if cond = 'data: post.author == "AUTHOR-1'" > 
< div class = 'individual' > < div class = 'author-img " > 
< a href = ' http://ENDERE -CO-OF-THE-AUTHOR PAGE-1 " >
< img alt = '' height = '74 ' src = ' http://ENDERE CO-OF-THE-AUTHOR-PICTURE-1 ' width = '64 ' /> </ a > 
</ div > 
< div class = 'author-text " > 
< h3 > < a href = ' http://ENDERE -CO-OF-THE-AUTHOR PAGE-1 ' > NAME OF AUTHOR 1 </ a > </ h3 >
< p > Descriptive text </ p >
</ div > < font > </ font >
< div style = "clear: both" /> 
</ div > 
</ b: if > 
< b: if cond = 'data: post.author == "AUTHOR-2'" > 
< div class = 'individual' > < div class = 'author-img " > 
< a href = ' http://ENDERE CO-OF-THE-PAGE-AUTHOR-2 " > 
< img alt = '' height = '74 ' src = ' http://ENDERE CO-OF-THE-AUTHOR-PICTURE-2 ' width = '64 ' /> </ a >
</ div > <
< div class = 'author-text " > 
< h3 > < a href = ' http://ENDERE CO-OF-THE-PAGE-AUTHOR-2 ' > NAME OF THE AUTHOR 2 </ a > </ h3 > 
< p > Descriptive text </ p > 
</ div > 
< div style = "clear: both" /> 
</ div > 
</ b: if > 


<!--- Need to open as many conditional ----> 
</ div > <!--- close the div for post-footer-line post-footer-line-1 ---> 


</ div > <!--- close the div for post-footer --->

Need to open as many conditional


Examples of styles applied to class created:


/ * Style for the container * / 
.  Individual {
background : # F1F0EB ; 
border-top : 1px solid # CC0000 ;
border-bottom : 1px solid # CC0000 ; 
margin : 0 2px 9px 0 ;
padding : 5px ;}


/ * Style for the avatar image * / 
. Author-img {
float : left ; margin-right : 3px ;} 


/ * Styles for text * / 
.  {Author-text 
color : # 333 ; 
font-size : 12px ;}
/ * Styles for links in the text * / 
. Author-text a: link,. Author-text a: visited {
color : # CC0000 ; 
font-size : 12px ; 
text-transform : uppercase ;} 


. Author-text a: hover {
color : # CC0000 ;
text-decoration : underline ;} 


3) Separate the AdSense publisher according to the author of the post



You can use ads in the account of each author, or a single account. In the second case, so you can manage the pages of the results of each author, the first procedure is to create a criterion in the AdSense settings, for example, naming this criterion with the author's name: Then, when creating the ad includes the criteria with the name of the author. This will generate a google_ad_slot different for each criterion. The account administrator can get a report sorted by criteria.


<Script type = "text / javascript" ><!--
google_ad_client = "pub-xxxxxxxxxxxxx" ;
/ * 234x60, post-title, author Krish * /
google_ad_slot = "123456789" ;
google_ad_width = 234;
google_ad_height = 60;
//-->
</ Script>
<Script type = "text / javascript"
src = " http://pagead2.googlesyndication.com/pagead/show_ads.js " >
</ Script>



3.1.) Adding the code in posts


To add the code in posts, the reasoning is also similar to the previous sections. Be the account code of the individual post author or the account code with the general criteria, simply enter each code between conditionals. In the example code is on the line below the title of posts:




< div class = 'post-header-line-1 " > 
< b: if cond = 'data: post.author == "AUTHOR-1'" > 
<!--- Adsense code for the AUTHOR-1 ---> 
< b: else /> 
< b: if cond = 'data: post.author == "AUTHOR-2'" > 
<!--- Adsense code for the AUTHOR-2 ---> 
< b: else /> 
<!--- Adsense code administrator ---> 
</ b: if > </ b: if > 


</ div > <!--- close the div post-header-line-1 ---> 





3.2.) Adding the code into a widget - sidebar, header, crosscol, etc.


This case is already more complicated because Blogger will not "understand" the tag date: post.author out of the widget "Blog." The solution is to create a new blog widget (see article of Fernando Quite Random ), where we put the includable

important.

Decide where you want to add the widget (sidebar, header, crosscol);
In "Edit HTML" leave unchecked the option "Expand Widget Templates";
Add the code in the chosen location, below the opening b: section. In the example, I put the widget in the sidebar:


< b: section class = 'sidebar' id = 'sidebar' preferred = 'yes' >
 < b: widget id = 'Blog99' locked = 'false' title = 'Blog Ads' type = 'Blog " >
< b: includable id = 'main' var = 'top' >
< b: if cond = 'data: blog.pageType == "item" " >
< b: loop values ​​= 'data: posts' var = 'post' >
< b: include data = 'post' name = 'post' />
</ b: loop >
</ b: if >
</ b: includable >

< b: includable id = 'post' var = 'post' >
< center >
< div class = 'ads-per-author " >
 < b: if cond = 'data: post.author == "AUTHOR-1'" >
<!--- Adsense code AUTHOR-1 --->
< b: else />
< b: if cond = 'data: post.author == "AUTHOR-2'" >
 <!--- Adsense code AUTHOR-2 --->
 < b: else />
 <!--- Adsense code administrator --->
 </ b: if > </ b: if >
</ div >
</ center >
</ b: includable >
</ b: widget >
 </ b: section > 

These were some uses that I developed using the conditional data: post.author, But there are probably many other similar hacks which can be applied.

Post a Comment

.