Z-blog add ad code method Daquan (Google-AdSense), other can also.

Source: Internet
Author: User

Z-blog add ad code method Daquan (Google-AdSense), other can also.

I found that many bloggers on the Forum asked how to add advertisements. Today, I finally took the time to summarize some of the places in Z-blog that are suitable for advertising code, and write the specific steps for adding code to you. I hope you can make a little money When writing your blog.

Preparations before adding the code: In the Z-blog background, there is no "index reconstruction", only "file reconstruction ". However, in many cases, "index reconstruction" is very useful. For example, after adding advertisement code to the blog homepage, you can "index reconstruction" without "file reconstruction ". Next we will teach you how to display "index reconstruction" in the background ".
Open the file admin/admin_left.asp in sequence and find the following code:
<! -- <P class = "button1"> <a onclick = 'Return changebuttoncolor (this) 'href = ".../CMD. asp? Act = blogrebuild "target =" Main "> <% = zc_ms000072 %> </a> </P> --> (remove the red part ),

Save the file and upload the modified file to the server.

I. Add an advertisement to the top of the homepage
Open \ template \ default.html and \ template \ single.html under the current topic of the blog and find the following code:
<Div id = "divall">
<Div id = "divpage">
<Div id = "divmiddle">
<Div id = "divtop">
Add advertisement code here
</Div>
<H1 id = "blogtitle"> <a href = "<# zc_blog_host #>"> <# zc_blog_name #> </a> <H2 id = "blogsubtitle"> <# zc_blog_sub_name #> </H2>
Note:
1. You can add the Google Adsense advertisement code directly in the red part. Of course, other advertising codes, such as alimama and Baidu topic promotion alliance, can also be used. We recommend that you add the "468*60" advertisement unit.
2.default.htmland single.html files must be modified. After uploading the modified files to the server, "index reconstruction" is required, and "file reconstruction" is not required ".


2. Add an advertisement at the bottom of the homepage text
Open \ template \ default.html under the current topic of the blog and find the following code:
<Div id = "divmain">
<# Template: article-Multi #>
Add advertisement code here
<Div class = "pagebar Post"> <# zc_ms000042 #>:< # template: pagebar #> </div>
</Div>
Note: "index reconstruction" is required, and "file reconstruction" is not required ". We recommend that you add "728*90" advertising unit or "728*15" Link unit.


3. Add advertisement on the sidebar of the homepage
Open \ template \ default.html under the current blog topic and find the following code:
<H3> <# zc_ms000026 #>
</H3>
<Ul>
<# Cache_include_catalog #>
</Ul> <Div style = "float: Left; clear: Left; Height: 1px; width: 1px">
</Div>
<Div style = "height: 90px; width: 160px; float: Left; clear: Left; padding: 0px; margin-top: 12px">
Add advertisement code here
</Div>
Note:
1. Add the ad code in the red part, and add the blue part at the same time. Otherwise, it is displayed as abnormal. We recommend that you add "120*240" advertising units, "180*150" advertising units, or "180*90" and "180*60" Link Units. 2. Where Height: 90px; width: 160px is the size of the advertisement code. You can adjust the size of the advertisement accordingly.
3. According to the code added in the above method, the advertisement will be displayed under the "website category" area. In fact, Google Adsense code can be added after any functional block, such as "recent message" and "Article classification. The methods are the same.
4. "index reconstruction" is required, and "file reconstruction" is not required ".


4. Add advertisement in the upper-left corner of the Content Page
Find the current topic folder of the blog, open \ template \ B _article-single.html, and find the following code:
<Div class = "entry"> <# Article/content #> </div>:
<Div class = "entry"> Add the advertisement code here
<# Article/content #> </div> and save the settings.
Note: "file reconstruction" is required ". We recommend placing "200*200" and "250*250" advertisement units.

5. Add advertisement methods on the Content Page
Find the file \ template \ B _article-single.html under the current blog template file
Find <Div class = "post-Body"> and add the advertisement code below it.
<Div class = "post-Body">
<Div style = "float: Left; clear: Left; Height: 200px; width: 1px">
</Div>
<Div style = "height: 250px; width: 250px; float: Left; clear: Left; padding: 0px; margin-top: 12px">
Add the advertisement code here </div>
<# Article/content #> </div>
Note:
1. height and width can be customized according to the advertisement size. The blue code must be added at the same time. Otherwise, it is displayed as abnormal.
2. "file reconstruction" is required to see the effect.


6. Add an advertisement at the top of the article comment
Find the template \ B _article_commentpost.html file in the current template file of the blog and edit it as follows:
<Div class = "Post" id = "divcommentpost">
<P class = "posttop"> <a name = "comment"> <# zc_ms000024 #> </a> </P>
Add advertisement code here
<Form ID = "frmsumbit" target = "_ Self" method = "Post" Action = "<# Article/commentposturl #>">
<Input type = "hidden" name = "inpid" id = "inpid" value = "<# Article/ID #>"/>
<Input type = "hidden" name = "inparticle" id = "inparticle" value = ""/>
<Input type = "hidden" name = "inplocation" id = "inplocation" value = ""/>
<P>
Note: "file reconstruction" is required ". We recommend that you add the "468*60" advertisement unit.


7. In addition, add advertisement code in three functional blocks, including "website favorites", "Friendship link", and "icon collection" on the homepage, because the code can be directly added in the background, I will not repeat it here. For example



The above method is also suitable for other advertising alliances, such as alimama. In addition, we have to say that adding advertisements must be moderate and focus on optimization. Otherwise, not only can we not make any money, it may also scare away blog readers and reduce user experience. More ways to add ads...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.