dmandwp前端效果库

dmandwp改动wordpress主题。使用dm的头部,banner,分类列表和详情页

日期:2020-12-07 阅读:879

这里以astra主题为例。

如果使用dmandwp的整站方案,需要修改wordpress主题的个别文件。

改动wordpress主题根目录下的 header.php

 <?php 
require   BLOCKROOT.'tpl/dmheader.php';
  require BLOCKROOT.'tpl/dmbanner.php';
?>
------------
显示模板文件:
<?php
 global $showwpwhichmb;
 if($showwpwhichmb=='y'){
   global $template;
     echo '<div style="background:red;color:#fff;text-align:center;padding:5px;font-size:14px">'.basename($template).'</div>';  
}
 
然后在dm后台->网站设置,开启 显示模板文件
 
-----------
page.php
要在页面显示banner,要在page.php的最上面加  : 
require   BLOCKROOT.'tpl/wphead/head_page.php';
-----------
 archive.php 
最上面加:require   BLOCKROOT.'tpl/wphead/head_archive.php';
 
列表位置加:
<?php 
          require    BLOCKROOT.'tpl/dm_'.TPLCURNAME.'/content/content_list.php'; 
?>
----------------
single.php 
最上面加:require   BLOCKROOT.'tpl/wphead/head_single.php';
 
详情位置加:
 <?php 
          require  BLOCKROOT.'tpl/dm_'.TPLCURNAME.'/content/content_single.php'; 
           ?>
----------
footer.php
 
使用浮动窗口:

 <?php  
 //浮动窗口部分
 global $bsfooterlast;
 block($bsfooterlast); ?>

---------------------

使用dm的底部:
<?php  
global $bsfooter;
if($bsfooter<>'')  {
?>
<footer class="footerwrap"> 
<div class="footer">
<?php 
block($bsfooter); 
?>
</div>
</footer>
<?php  } 
 
  ?>