Wordpress 常用代码解释

作者:Wordpress 常用代码解释 来源:未知 2022-06-21 09:07   阅读:

添加head头文件:判断后调用js文件添加css代码到样式文件内ll#tab{ltext-align:left;lposition:relative;l}l.menu{lbackground

添加 head 头文件:判断后调用 js文件 
 
 
 
 
 
添加 css 代码到 样式文件内 
l  
l #tab{ 
l text-align:left; 
l position:relative; 
l } 
l .menu { 
l background-color:#ececec; 
l color:#; 
l border-bottom:1px solid #d7d7d7; 
l height:23px; 
l width:450px; 
l vertical-align:middle; 
l } 
l .menu ul { 
l margin:0px; 
l padding:0px; 
l list-style:none; 
l text-align:left; 
l } 
l .menu li {display:inline; 
l line-height:23px;} 
l 
l .menu li a {color:#; 
l text-decoration:none; 
l padding:4px 5px 6px 5px; 
border-left:1px solid #ececec; 
l border-right:1px solid #ececec; 
l } 
l .menu li a.tabactive {border-left:1px solid #d7d7d7; 
l border-right:1px solid #d7d7d7; 
l background-color:#CCCCCC; 
l font-weight:bold; 
l position:relative;} 
l 
l #tabcontent1,#tabcontent2,#tabcontent3,#tabcontent4 { 
l border:1px solid #ececec; 
l width:450px; 
l text-align:left; 
l padding:6px 0px; 
l font-size:12px; 
l margin:2px 0 5px 5px; 
l } 
l 
l 
l #container1 #newcomment,#container #newcomment{ 
l 
l position: relative; 
l margin-left:30px; 
l width:350px; 
l } 
l 
l #container1 #reping,#tabcontent1 #reping{ 
l position: relative; 
l margin-left:30px; 
l width:350px; 
l } 
l 
l #container1 #rand li, #tabcontent2 #rand li{ 
l margin-left:30px; 
l padding:0; 
l } 
l 
l 
添加 tab代码到需要调用的地方 
 

最新关注日志及评论

comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID=$wpdb->posts.ID) WHERE comment_approved='1' AND comment_type='' AND post_password='' ORDER BY comment_date_gmt DESC LIMIT 10"; $comments=$wpdb->get_results($sql); $output=$pre_HTML; foreach ($comments as $comment) { $output .="
  • ".strip_tags($comment->comment_author).":" . "ID). "#comment-" . $comment->comment_ID . "" title="on " . $comment->post_title . "">" . strip_tags($comment->com_excerpt)."
  • "; } $output .=$post_HTML; echo $output;?>
    get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10"); foreach ($result as $topten) { $postid=$topten->ID; $title=$topten->post_title; $commentcount=$topten->comment_count; if ($commentcount !=0) { ?>
  • ">


  • 保存 js代码到目录下 //EASY TABS 1.2 - MENU SETTINGS //Set the id names of your tablink (without a number at the end)设置链接的tab页签名称 var tablink_idname=new Array("tablink") //Set the id name of your tabcontentarea (without a number at the end)设置tab内容区域id名称 var tabcontent_idname=new Array("tabcontent") //Set the number of your tabs//设置tab的个数 var tabcount=new Array("2") //Set the Tab wich should load at start (In this Example:Tab 2 visible on load) var loadtabs=new Array("1") //Set the Number of the Menu which should autochange (if you dont't want to have a change menu set it to 0) var autochangemenu=0; //the speed in seconds when the tabs should change var changespeed=3; //should the autochange stop if the user hover over a tab from the autochangemenu? 0=no 1=yes var stoponhover=0; //END MENU SETTINGS function easytabs(menunr, active) {if (menunr==autochangemenu){currenttab=active;}if ((menunr==autochangemenu)&&(stoponhover==1)) {stop_autochange()} else if ((menunr==autochangemenu)&&(stoponhover==0)) {counter=0;}menunr=menunr-1;for (i=1; i <=tabcount[menunr]; i++){document.getElementById(tablink_idname[menunr]+i).className='tab'+i;document.getEleme ntById(tabcontent_idname[menunr]+i).style.display='none';}document.getElementById(tablink_idname[menunr]+active).className='tab'+active+' tabactive';document.getElementById(tabcontent_idname[menunr]+active).style.display='block';}var timer; counter=0; var totaltabs=tabcount[autochangemenu-1];var currenttab=loadtabs[autochangemenu-1];function start_autochange(){counter=counter+1;timer=setTimeout("start_autochange()",1000);if (counter==changespeed+1) {currenttab++;if (currenttab>totaltabs) {currenttab=1}easytabs(autochangemenu,currenttab);restart_autochange();}}function restart_autochange(){clearTimeout(timer);counter=0;start_autochange();}function stop_autochange(){clearTimeout(timer);counter=0;} window.onload=function(){ var menucount=loadtabs.length; var a=0; var b=1; do {easytabs(b, loadtabs[a]); a++; b++;}while (b<=menucount); if (autochangemenu!=0){start_autochange();} }

    分享给小伙伴们:
    Wordpress 常用代码解释:如果本文侵犯了您的权利, 请联系本网立即做出处理,谢谢。
    当前位置:殿试作文网 > 三潭印月作文Wordpress 常用代码解释转载请注明出处。
    下一篇:没有了
    Wordpress 常用代码解释相关文章