版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Wp百科网企业模板制课程目标:制作出一个企业的课后作业:跟着,完成一个相同的制作课 第一课、企业模板介 第二课、模板拆分制 第三课、首页模板文 第四课、其他页面制 第五课、模板组件专 1、首页产品和滚动25、page1、wordpress23、企业模板文档4firebug5、DW1、移动.css样式文件到文件夹内,并重命名为2、添加信息ThemeName:WPThemeURI:Author:WP百科网AuthorURI:Version:1.0Tags:white,WP百科网,<?phpbloginfo('stylesheet_url');<?phpbloginfo('temte_directory');<?php
charset=<?phpbloginfo('charset');?>"/>SEO <?phpinclude(TEMTEPATH.'/seo.php');Hook <?phpwp_head();functions.php<?phpadd_filter('show_admin_bar','return_false'functions.php'header-'=>('导航自定义菜单') _id'=>'nav_sgBhgn'));?>扩展知识//最外层容器的名,默认div'container'=>'div',//class'container_class'=>//id'container_id'=> //导航菜单ul的class _class'=>//导航菜单ul的id _id'=>//true,如果想将导航的代码作为赋值使用,可设置为'echo'=>//备用的导航菜单函数,用于没有在设置导航时调'fallback_cb'=>//显示在导航a之'before'=>//显示在导航a之'after'=>//显示在导航名之'link_before'=>//显示在导航名之'link_after'=>//0,0'depth'=>'walker'=>newWalker_Nav_(),'theme_location'=>'primary',<?php<?php$rand_posts=get_posts('category=ID&numberposts=5&orderby=date');foreach($rand_postsas$post):?><li><ahref="<?phpthe_permalink();?>"><?phpthe_title();<?php按钮<?phpechoget_option('home');3<?phpwp_list_categories('title_li=0&orderby=name&show_count=0&depth=0');Css transparent;padding-left:15px;font-weight:bold;}.prod_typeulliulli{background:url("images/minus.gif")no-repeatscroll010pxtransparent;margin-left:-8px;font-weight:normal;}.prod_typeullia{height:30px;d_typeulul{dis4、友情只在首页显<?phpif(is_home()){<?phpwp_list_bookmarks('title_li=&categorize=0&orderby=rand&limit=24');<?php}<?phpadd_filter('pre_option_link_manager_enabled','return_true');通过WP调用回来,调用底部<?php2 Copyright©2014-2018<ahref=”<?phpechoget_option('home');?>”><?phpbloginfo(‘name’);?></a>Allrights.3hook<?php<?phpquery_posts('page_id=2');//ID<?phpwhile(have_posts()):the_post();<?phpechomb_strimwidth(strip_tags(apply_filters('the_content',$post->post_content)),0,300,"……");//修改显示字数?><?php2、调用产品<?phpif(have_posts()):<?phpwhile(have_posts()):the_post();<?phpendwhile;<?phpendif;wp_reset_query();<ahref="<?phpthe_permalink()?>"><?phpechomb_strimwidth(get_the_title(),0,16,'');?></a>、缩略图文件thumbnail.php到文件夹中、在文件夹里面的functions.php文件中添加下面代码if(function_exists('add_theme_support'))functioncatch_first_image(){global$post,$first_img=''; $post-$first_img=$matches[1]if(empty($first_img)){//Definesadefault$random=mt_rand(1,echoget_bloginfo('stylesheet_directory');echo'/images/random/'.$random.'.jpg';}return}、在images文件夹下建立random文件夹,放入默认缩略图,名称必须为1~10<?phpinclude(TEMTEPATH.'/thumbnail.php');在循环if(have_posts())和while(have_posts()):the_post();之间添加以下代码<?phpquery_posts('cat=3'.$mcatID.'&caller_get_posts=1&showposts=6');2div<div<div<div<divclass="thumb"><ahref="#"><imgsrc=""border="0"<divclass="thumb"><ahref="#"><imgsrc=""border="0"<divclass="thumb"><ahref="#"><imgsrc=""border="0"<div3、以下js代码至文件中varspeed=10;vartab=.gevartab1=.gevartab2=.geementById("demo2");functionMarquee(){}}varMyMar=setInterval(Marquee,speed);tab.onmouseover=function(){clearInterval(MyMar)};tab.onmouseout=function(){MyMar=setInterval(Marquee,speed)};4、css样#demo{background:#FFF;overflow:hidden;width:500px;}#demoimg{border:3pxsolid#F2F2F2;}#indemo{float:left;width:800%;}#demo1{float:left;}#demo2{float:left;.thumb5<?phpif(have_posts()):<?phpquery_posts('cat=3'.$mcatID.'&caller_get_posts=1&showposts=6');<?phpwhile(have_posts()):the_post();<?phpendwhile;<?phpendif;wp_reset_query();6、替换循环里面的代码为缩略图调用代码和标题<ahref="<?phpthe_permalink()?>"><?phpechomb_strimwidth(get_the_title(),0,16,'');?></a>头部
<?php<?php<?php<?phpif(have_posts()):<?phpwhile(have_posts()):the_post();<?phpendwhile;<?phpendif;wp_reset_query();<ahref="<?phpthe_permalink()?>"><?phpechomb_strimwidth(get_the_title(),0,16,'');?></a>
<?php
<?php<?phpwp_pagenavi();2节:产品展示页面(category-slug.phpcategory-头部
<?php<?php<?php3<?phpif(have_posts()):<?phpwhile(have_posts()):the_post();<?phpendwhile;<?phpendif;wp_reset_query();<ahref="<?phpthe_permalink()?>"><?phpechomb_strimwidth(get_the_title(),0,16,'');?></a>、调用<?phpinclude(TEMTEPATH.'/thumbnail.php');<?php<?phpwp_pagenavi();1、制作头部
<?php<?php<?php<?phpif(have_posts()):<?phpwhile(have_posts()):the_post();<?phpendwhile;<?phpendif;wp_reset_query();
<?php
<?php
<?phpthe_content("");
<?phpthe_category(',')文章
<?phpthe_tags(':',',','');js<scriptlanguage="javascript"type="text/javascript">functionContentSize(size){varobj= }<a<a4
<?phpprevious_post_link('%link');
<?phpnext_post_link('%link<?phpif(get_previous_post(previous_post_link(‘%link’else{echo“没有了,已经是最后文章”;}?><?phpif(get_next_post()){next_post_link(‘%link’);}else{echo新文章”<?phpif(function_exists('the_views')){the_views();}6、文<?php$rand_posts=get_posts('numberposts=10&orderby=date');foreach($rand_posts$post):<li><ahref="<?phpthe_permalink();?>"><?phpechomb_strimwidth(get_the_title(),0,32,'');?></a></li><?php获取存放路径<?phpbloginfo('temte_directory');$cats=wp_get_post_categories($post->ID);if($cats){$args='categoryin'=>array($cats[0]),'postnot_in'=>array($post->ID),'showposts'=>6,'caller_get_posts'=>if(have_posts())while(have_posts()):the_post();update_post_caches($posts); the_title_attribute();?>"><?phpthe_title();?></a></li><?phpendwhile;else:<li>*暂无相关文章<?phpendif;wp_reset_query();} 并在<?phpendwhile;?>后添加未找到提示文字:<?phpelse:<h3><ahref="#">未找到<formmethod="get"action="<?phpbloginfo('u
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 社区足浴店活动方案
- 社会义卖活动方案
- 社区活动环保彩绘活动方案
- 秋分团建活动方案
- 种植教学活动方案
- 社区志愿者马甲活动方案
- 社区消防实战活动方案
- 童心市集活动方案
- 科技公司七夕活动方案
- 社区开展市集活动方案
- GB/T 17747.2-2011天然气压缩因子的计算第2部分:用摩尔组成进行计算
- 2023年研究生自然辩证法概论期末考试题库
- 2022年南京六合经济技术开发集团有限公司招聘笔试试题及答案解析
- 伦理学与生活第二三四五章(规范伦理学)-1P课件
- DB61-T 1061-2017挥发性有机物排放控制标准
- 小学数学 冀教课标版 四年级上册 典型问题 典型问题(例题5)课件
- Unit3 Starting out课件-高中英语外研版必修第一册
- 桂林市高考调研考试质量分析报
- 中职《机械基础》全套课件(完整版)
- 电子商务客户服务5套综合测试题带答案
- 第5章-非平衡载流子-习题讲解..
评论
0/150
提交评论