WordPress一些使用心得
1.插入广告方法打开后台:wp-content/themes/head.php添加的为首页横幅的.和插入到内容页面 顶部找到你的主题: 然后修改 :将<?php if(is_home()) 等其它内容替换为如下: <?php if(is_home() ) { ?> <script type="text/javascript"><!--google_ad_client = "pub-ssafasdfs";/* auaus.com */google_ad_slot = "208sdfds9056102";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> <?php } else{ ?> <script type="text/javascript"><!--google_ad_client = "pub-6384804769sdfsd484979";/* auaus.com */google_ad_slot = "20890sdfds56102";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> <?php }?>广告插入到文章中的方法将 single.php下的内容替换<div class="entry-content"><div style="float:left"><script type="text/javascript"><!--google_ad_client = "pub-6384804769484979";/* auaus-lwxshow */google_ad_slot = "2874989003";google_ad_width = 250;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>2.更换域名,后台无法访问的解决办法首先用 phpmyadmin 打开数据库,然后找到 wp-options 数据表,找到第一条记录,也就是siteurl这条,还有第39条 home,这两条记录里的原域名URL将地址换成新域名即可。博客内容中原域名URL批量更新,可以执行语句:Update wp_posts SET post_content = replace(post_content,'http://www.olddomain.com','http://www.newdomain.com');
页:
[1]