织梦广告代码(最全篇)一、添加方法1、添加广告(可省略)模块--铺助插件-广告管理-添加2、调用代码模板-默认模板管理:列表页头部模板head.htm、底部模板footer.htm、主页模板index.htm,文章内容页模板article_article.htm等,相应位置将下方红色的(自定义人生励志网)替换成广告代码。
二、首页广告主页模板index.htm1、logo右边468*60最佳。
广告管理—系统自带的广告—–更改—–正常显示内容–把自己的广告代码(图片)放入。
2、导航与搜索框之间(首页及频道栏目)960*90最佳。
列表页头部模板head.htm</div>(自定义人生励志网)<!– /nav –><div class=”search”><div class=”w960 center”>3、搜索框下方(首页及频道栏目)960*90最佳。
列表页头部模板head.htm<div class="tags"><h4>热门标签</h4><ul>{dede:tag row='8' getall='1' sort='month'}<li><ahref='[field:link/]'>[field:tag /]</a></li>{/dede:tag}</ul></div></div><!-- //search --></div>(自定义人生励志网)</div></div><!-- //header -->4、图文资讯下方700*60最佳。
新建广告<!-- /picnews --><div class="listbox">{dede:channelartlist}(自定义人生励志网)<dl class="tbox">5、友情链接上方(各板块下)700*60最佳。
新建广告板块下<!– /listbox –>(自定义人生励志网)</div><!– /pleft –><div class=”pright”><div class=”usercenter”><dl class=”tbox”><dt> <strong>互动中心</strong> <span class=”label”> <a href=”#” _for=”uc_digg”>踩踩………………….友情链接上方其他途径</div><div class="submit"><button type="submit" class="btn-1">投票</button><a href="plus/vote.php?dopost=view&aid=1">查看结果</a></div></dd></form></dl></div><!-- /vote --></div><!-- /pleft --></div>广告位代码放在这里<div class="flink w960 center mt1 clear"><dl class="tbox"><dt><strong>友情链接</strong><span class="more"><a href="plus/flink.php">所有链接</a> | <ahref="plus/flink_add.php">申请加入</a>6、互动中心与推荐内容之间250*250最佳。
<!-- /usercenter --><div class="commend mt1"><dl class="tbox light">(自定义人生励志网)<dt class='light'><strong>推荐内容</strong></dt>7、本月热点与投票调查之间250*250最佳。
<div class="hot mt1"><dl class="tbox light"><dt class='light'><strong>本月热点</strong></dt><dd class='light'><ul class="c1 ico2">{dede:arclist sort='hot' subday='30' titlelen=42 row=12}<li class='dotline'><ahref="[field:arcurl/]">[field:title/]</a></li>{/dede:arclist}</ul></dd></dl></div><div class="vote mt1"><dl class="tbox light">(自定义人生励志网)</div>三、频道栏目页文章频道封面模板index_article.htm右侧边栏(1、热点点内容上面自定义人生励志网)<div class="hot mt1"><dl class="tbox light"><dt class='light'><strong>热点内容</strong></dt>(中间代码略)</div>(2、热点点内容下面自定义人生励志网)</div><!-- /pright -->3、logo右边、搜索框上下如首页四、文章内容页文章内容页模板article_article.htm右侧边栏250*250最佳。
<div class="commend mt1"><dl class="tbox light">(1、栏目与推荐之间自定义人生励志网)<dt class='light'><strong>推荐内容</strong></dt><dd class='light'><ul class="d4">{dede:arclist flag='c' titlelen=42 row=6}<li><a href="[field:arcurl/]">[field:title/]</a><p>[field:description function='cn_substr(@me,80)'/]...</p> </li>{/dede:arclist}</ul></dd></dl></div><!-- /commend -->(2、推荐与热点之间自定义人生励志网)<div class="hot mt1"><dl class="tbox light"><dt class='light'><strong>热点内容</strong></dt><dd class='light'><ul class="c1 ico2">{dede:arclist row=10 orderby=click}<li><a href="[field:arcurl/]">[field:title/]</a></li>{/dede:arclist}</ul></dd></dl></div>(3、热点下自定义人生励志网)</div><!-- /pright --></div>{dede:include filename="footer.htm"/}<!-- /footer -->文章内容中<div class="w960 center clear mt1"><div class="pleft"><div class="viewbox"><div class="place"><strong>当前位置:</strong> {dede:field name='position'/}</div><!-- /place -->(4、题目上面自定义人生励志网)<div class="title"><h2>{dede:field.title/}</h2></div><!-- /title --><div class="info"><small>时间:</small>{dede:field.pubdate function="MyDate('Y-m-dH:i',@me)"/}<small>来源:</small>{dede:field.source/} <small>作者:</small>{dede:field.writer/} <small>点击:</small><script src="{dede:field name='phpurl'/}/count.php?view=yes&aid={dede:field name='id'/}&mid={dede:field name='mid'/}" type='text/javascript' language="javascript"></script>次</div><!-- /info -->(5、来源作者下,适合文字链自定义人生励志网)<div class="content"><table width='100%'><tr><td>{dede:field.body/}</td></tr></table></div><!-- /content --><div class="dede_pages"><ul class="pagelist">{dede:pagebreak/}</ul></div><!-- /pages -->(6、“顶一下”上面自定义人生励志网)<!-- //顶踩 --><div class="newdigg" id="newdigg"><div class="diggbox digg_good" onmousemove="this.style.backgroundPosition='left bottom';" onmouseout="this.style.backgroundPosition='left top';"onclick="javascript:postDigg('good',{dede:field.id/})"><div class="digg_act">顶一下</div><div class="digg_num">({dede:field.goodpost/})</div><div class="digg_percent"><div class="digg_percent_bar"><spanstyle="width:{dede:field.goodper/}%"></span></div><div class="digg_percent_num">{dede:field.goodper/}%</div></div></div><div class="diggbox digg_bad" onmousemove="this.style.backgroundPosition='right bottom';" onmouseout="this.style.backgroundPosition='right top';"onclick="javascript:postDigg('bad',{dede:field.id/})"><div class="digg_act">踩一下</div><div class="digg_num">({dede:field.badpost/})</div><div class="digg_percent"><div class="digg_percent_bar"><spanstyle="width:{dede:field.badper/}%"></span></div><div class="digg_percent_num">{dede:field.badper/}%</div></div></div></div><script language="javascript"type="text/javascript">getDigg({dede:field.id/});</script><!-- //顶踩部份的源码结束 -->(7、“顶一下”下面)<div class="boxoff"><strong>------分隔线----------------------------</strong></div><div class="handle"><div class="context"><ul><li>{dede:prenext get='pre'/}</li><li>{dede:prenext get='next'/}</li></ul></div><!-- /context --><div class="actbox"><ul><li id="act-fav"><a href="{dede:fieldname='phpurl'/}/stow.php?aid={dede:field.id/}" target="_blank">收藏</a></li><li id="act-err"><a href="{dede:fieldname='phpurl'/}/erraddsave.php?aid={dede:field.id/}&title={dede:field.title/}" target="_blank">挑错</a></li><li id="act-pus"><a href="{dede:fieldname='phpurl'/}/recommend.php?aid={dede:field.id/}" target="_blank">推荐</a></li><li id="act-pnt"><a href="#" onClick="window.print();">打印</a></li></ul></div><!-- /actbox --></div><!-- /handle --></div><!-- /viewbox -->注意:为了好看以上代码放到<center> </center> 居中代码之间!8、文章中的环绕广告打开\templets\default\article_article.htm文件<div class="info"> <small>时间:</small>{dede:field.pubdatefunction="MyDate('Y-m-d H:i',@me)"/}<small>来源:</small>{dede:field.source/} <small>作者:</small>{dede:field.writer/} <small>点击:</small><script src="{dede:field name='phpurl'/}/count.php?view=yes&aid={dede:field name='id'/}&mid={dede:field name='mid'/}" type='text/javascript'language="javascript"></script>次</div><!-- /info --><div class="content">(自定义人生励志网)<table width='100%'><tr><td><div id="contentMidPicAD" style="float:right; clear:both; top:0; vertical-align:top;">{dede:myad name='contentMidPicAD'/}</div>{dede:field.body/}{dede:field.vote/}<br /><span style="float:right">(责任编辑:自定义人生励志网 <ahref="" title="自定义人生励志网"target="_blank"></a>)</span></td>注意:广告文字混排:1.按这个路径找到这个文件/images/article.css在此文件下搜索这个代码/*---------------内容页:正文*/.newsview .content{width:638px;overflow:hidden;margin:10px auto;color:#444;font-size:14px;line-height:25px;在上面的代码前面加上一下的的代码/*---------------内容页:广告代码*/.newsview .ggad{margin-top:10px;float:left;width:250px; /这个可以自己定义height:250px; /这个可以自己定义OK 保存退出上传文件覆盖2. 去后台新建一个广告这个操作一次打开模块------辅助模块-----广告管理 [增加一个新广告]填好得到的广告代码是 {dede:myad name='body'/}3. 好了下面进行修改模板找到这个文件/templets/default/article_article.htm 打开以后找到下面的代码<!--资讯正文--><div class="content">在上面模板下面加上<div class="ggad" style="float: left" align="left">{dede:myadname='body'/}</div>{dede:field name='body'/}这个是左边的广告要是需要右边的加上<div class="ggad" style="float: right" align="right">{dede:myadname='body'/}</div>{dede:field name='body'/}9、logo右边10、搜索框下四、其他形式1、所有页面版权上方760*60最佳。