How to put an Advertisements code on Wordpress

If you read the articles in this blog, then at the beginning of the paragraph will be visible display local advertisements in Indonesian language (kliksaya.com). Display ads that are in the post is one of the tips that the ads get a lot of clicks from our readers, because of its position that integrates with the posting. Thus, it is also able to boost revenue from ads that are installed on our blog.

The actual method of advertising in this post has been recommended for a long time, but in reality there are many bloggers who know exactly how to put an ad in the post. Well, in this post I'll share a few tips about how to advertise to appear together with the posting. It should be noted, this tip only applies to any wordpress blog.
The standard way Installing Advertising on In Posts
The easiest way to display ads in the post is to add the code below into your wordpress blog theme single.php (read layout how!):



 <?php
$where = 0;
$content = apply_filters(‘the_content’, get_the_content());
$content = explode(“</p>”, $content);
for ($i = 0; $i <count($content); $i++) {
if ($i == $where) { ?>
<div style=”float:left; margin:0 10px 10px 0;“>

<!-- MASUKKAN KODE IKLAN ANDA DI SINI -->
</div>
<?php
}
echo $content[$i] . “</p>”;
}
?>

Tata is as follows:

    
Login to your wordpress blog dashboard, then go to the Appearance - Editor
    
Click to open the perfect single.php
    
Find <? Php the_content ('more'); ?> Or something similar code, and then replace it with the code above
    
Save and see the results
Do not forget to include the ad code that you will plug in the post by replacing the phrase <! - INSERT YOUR ADVERTISING CODE HERE -> in the above code with your ad script. You can also modify the above code based on need, such as changing the position of display advertising. This prompts:

    
$ Code where = 0; indicates that the ad will be shown in the first paragraph. If you replace the number 0 to number 1, the ad will appear in the second paragraph, and so on. Just change the numbers alone!
    
Code float: left; showed that the ads will be displayed at the left post. Well, if you want to display ads on the right post, then just change left to right, then save and see the results
    
Code margin: 0 10px 10px 0; suggests setting the upper limit, right, bottom and left advertising. You just playing with numbers in them to get the right position. Please try!
The standard way is actually quite easy and practical, but we are always expected to fill the post by a few paragraphs so that ads are not skewed. Well, for the blogger who sometimes only write one sentence or one paragraph just as psotingan, how to setup their ads? Easy, just follow the advanced way how to advertise in our blog post.


If you already use the first method above, it is not necessary anymore to take this advanced way. Remember, do not use this two ways at once in a blog. Please select just which way you think best suit the tastes of blogging that you have.

How to Install Advanced Advertising within PostingsTo further show how memeasang ads in the blog post is actually very easy. This method also has other advantages because we can manage to not show ads in the post if the article does not meet the number of characters that we set.Please copy and paste the code below into your wordpress blog theme functions.php:inject_ad_text_after_n_chars function ($ content) {// only do this if the post is longer than 1000 characters $ enable_length = 1000; // Insert after the first </ p> after 500 characters $ after_character = 500; if (is_single () && strlen ($ content)> $ enable_length) {$ before_content = substr ($ content, 0, $ after_character); $ after_content = substr ($ content, $ after_character); $ after_content = explode ('</ p>', $ after_content); $ text = '<! - INSERT YOUR ADVERTISING CODE HERE ->'; array_splice ($ after_content, 1, 0, $ text); $ after_content = implode ('</ p>', $ after_content); return $ before_content. $ after_content; } Else {return $ content; }add_filter ('the_content', 'inject_ad_text_after_n_chars');Note: Do not forget to fill your ad code in the above code before being put into function.php theme $ enable_length = 1000; is a code that indicates that your ads will only be shown if a post has at least 1000 characters. You can change the number of characters in accordance with the needs $ after_character = 500; is a code that indicates that your ad will be displayed after the 500th character of each post on your blog. Please change the number of characters as needed.2 ways above (choose only one of them, not both), you can enter any ad (java script, flash or HTML plain), both text ads and image ads. I own a lot of use of the above as a way to increase revenue google adsense of blogs that I manage.Good tips on How to Install Ads In WordPress Blog Posts can provide benefits for colleagues all! Ohya, if any fellow bloggers who have other tips how to place ads in a blog post, please divided here yes.


Thats it. Read Also : How to put an Advertisements code on Joomla   
 
Previous
Next Post »
0 Komentar