利用的HotNew Pro主题后,文章内容上面没有告白位,可是有时需要在谁人位置添加告白,就利用了一款叫Smart Ads 告白打点插件,这个插件可以在文章内容上面和下面添加告白,直到昨天我删掉了Smart Ads这款插件,因为我修改主题已经在文章内容上面集成了告白位,Smart Ads这款插件已经不在本站利用插件范畴内了。
下面说一下奈何在HotNew Pro主题文章内容上面添加告白位
1、新建一个文件adp.php,复制下面代码到内里
<div class="adt"><div class="ad_c"><?php echo stripslashes(get_option('swt_adpc')); ?>
<div class="clear"></div>
</div>
</div>
上传文件到HotNewspro/includes/目次下
2、修改靠山节制HotNewspro/includes/theme_options.php 添加这是靠山节制告白的找到下面代码
array( "name" => "是否显示正文底部告白","desc" => "默认显示",
"id" => $shortname."_adt",
"type" => "select",
"std" => "Hide",
"options" => array("Display", "Hide")),
array( "name" => "输入正文底部告白代码",
"desc" => "",
"id" => $shortname."_adtc",
"type" => "textarea",
"std" => '<a href=http://down.chinaz.com/"http:/faq.wopus.org/" target="_blank"><img src=http://down.chinaz.com/"http:/photo.staticsdo.com/a1/184/278/104/63440-772704496-8_765.jpg" alt="Wopus问答" /></a>'),
在下面添加
array( "name" => "是否显示正文上面告白","desc" => "默认显示",
"id" => $shortname."_adp",
"type" => "select",
"std" => "Hide",
"options" => array("Display", "Hide")),
array( "name" => "输入正文上面告白代码",
"desc" => "",
"id" => $shortname."_adpc",
"type" => "textarea",
"std" => '<a href=http://down.chinaz.com/"http:/faq.wopus.org/" target="_blank"><img src=http://down.chinaz.com/"http:/photo.staticsdo.com/a1/184/278/104/63440-772704496-8_765.jpg" alt="Wopus问答" /></a>'),
3、修改文章页面HotNewspro/single.php文件 找到
<div class="entry"><?php the_content('Read more...'); ?>
<?php wp_link_pages( array( 'before' => '<p class="pages">' . __( '日志分页:'), 'after' => '</p>' ) ); ?>
<div class="clear"></div>
</div>
<?php if (get_option('swt_adt') == 'Hide') { ?>
<?php { echo ''; } ?>
<?php } else { include(TEMPLATEPATH . '/includes/adt.php'); } ?>
<div class="clear"></div>
</div>
改成下面的
<div class="entry"><div id="entry">
<?php if (get_option('swt_adp') == 'Hide') { ?>
<?php { echo ''; } ?>
<?php } else { include(TEMPLATEPATH . '/includes/adp.php'); } ?>
<?php the_content('Read more...'); ?>
<?php wp_link_pages( array( 'before' => '<p class="pages">' . __( '日志分页:'), 'after' => '</p>' ) ); ?>
<div class="clear"></div>
</div>
<?php if (get_option('swt_adt') == 'Hide') { ?>
<?php { echo ''; } ?>
<?php } else { include(TEMPLATEPATH . '/includes/adt.php'); } ?>
<div class="clear"></div>
</div>
这就好了,靠山主题打点处告白打点添加打点光处就可以看到了
结果如下:
Wordpress下载:
WordPress v3.5 RC2下载