Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
See some websites before the ad output is very special, that is, in the text display ads, I said is not up and down, the left and right corner of the display method. To see the effect, you can look at the ads displayed in Bluefate's blog post. Because I'm not a program, but I know a little bit of PHP, so research for a while to write out a text in the output of advertising code:
<?php
Output the content of the article, when you encounter the first </p>, display ads
$form = 0;
$contents = Get_the_content ();
$lenght = Stripos ($contents, "</p>");//</p> to split character channeling and return in numeric form
$lenght = $lenght + ' 4 ', plus the number of characters in </p> station
$contents 1 = substr ($contents, $form, $lenght);//Intercept article
$contents 2 = substr ($contents, $lenght);
if (get_option (' Swt_adt ') = = ' Hide ' | | strlen ($contents) <= $lenght | | $lenght < 20) {//Output advertisement
The_content (");
}
else {
Echo $contents 1;//The first half of the output
Include TemplatePath. '/includes/adwz.php ');
Echo $contents the second half of 2;//output
}
?>
Save the above code for contents.php, the path in the template folder includes/contents.php, the article page single.php output when the article is replaced with the original < PHP the_content ("); >. Here to explain the code slightly, first use the get_the_content () function to get the content of the article, and then use the Stripos () function to return the specified string "</p>" position, and then use the substr () function to intercept the content into two parts; Finally through the judgment to display the advertisement, if the label </p> does not exist or the advertisement is hidden directly output the original article, otherwise output article before the paragraph + ads + the second half of the article. You can also use the number of judgments to display ads. Well, if you don't understand, you can contact me. Or have a good method, also please share, this article by Bluefate (http://www.bluefate.org/201205083039.html) original, welcome reprint, Thank you