Tips blogger,SEO, web,WordPress,informasi teknologi

how to put an ad right in wordpress

how to put an ad right in wordpress

how to put an ad right in wordpressmany ways to earn money from internet.good throughan> blogger, wordpress or other.this time I will back that can provide information to help earn income through earning wordpress. then you have to put an ad on google.

so how to put an ad right in wordpress:

Its operation as follows:

    1. Login to your wordpress blog dashboard, and then go to the Appearance - Editor
     2.Click to open single.php perfect
     3.Find the code <? Php the_content ('more'); ?> Or something similar code, and replace it with the code above
     4.Save and see the results

5.Do not forget to enter your ad code that will plug in the post sentence by replacing <! - ENTER YOUR AD CODE HERE -> in the code above with your ad script. You can also modify the above code based on need, such as changing the position of display advertising. It prompts:

     6.Code $ where = 0; showed that the ad will be shown in the first paragraph. If you change the number 0 to number 1, then the ad will appear in the second paragraph, and so on. Just change the numbers alone!
    7. Code float: left; showed that the ad will be displayed on the left post. Well, if you want to display ads on the right post, then replace it with a right left, then save and see the results
    8.Code margin: 0 10px 10px 0; shows the upper limit setting, right, bottom and left advertising. You live to play 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 with a few paragraphs so that the ads are not lame. Well, for a blogger who sometimes just write one sentence or one paragraph only as psotingan, how to setup the ad? Easy, just follow the advanced ways how to advertise in our blog post.

    9. If you are already using the first method above, it is no longer necessary to resort to this advanced. Remember, do not use these two ways at once in a blog. Please select any which way that you think best suits your tastes have blogging.

Continued way in In Post Ads posting

For advanced ways how memeasang ads in the blog post is actually very easy. This method also has other advantages as 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 the functions.php of your wordpress blog theme:

inject_ad_text_after_n_chars function ($ content) {
   // Only do this if 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 = '
       <! - ENTER YOUR AD 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 it is inserted into the functions.php theme
     $ enable_length = 1000; is a code that indicates that your ad will only be shown if a post has at least 1000 characters. You can change the number of characters in accordance with the requirements
     $ 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.

With 2 of the above (choose only one of them, not both), you can insert any advertisements (java script, flash or plain HTML), both text ads and image ads. I own a lot of use of the above as one way of increasing revenue from google adsense blogs I manage.
Tag : wordpress
0 Komentar untuk "how to put an ad right in wordpress"

Back To Top