手册里面首页调用单独板块内容为啥不显示,复制的手册里面的代码。

woshisiyu2023-04-01  424

 

      <!--id1的栏目开始-->
	  <?php $_forum = $arrlist['list'][1];?>
      <div class="guessTitle special">
        <h2> 生活百科</h2>
        <a href="<?php echo $_forum['url'];?>">更多&gt;&gt;</a> </div><!--这里的链接没起作用-->
      <div class="secondLeftLists beaut"> 
       <?php if (!empty($_forum['news'])) {$i=0; foreach ($_forum['news'] as $_thread) {if ($_thread['icon_text'] && ++$i <= 2) { ?>
       <a href="<?php echo $_thread['url'];?>" title="<?php echo $_thread['subject'];?>">
        <div class="secondLeftList">
          <div class="secondLeftListImg"> <img class="lazyload" src="/kaifadou/static/images/default.jpg" data-original="<?php echo $_thread['icon_text']; ?>" alt="<?php echo $_thread['subject'];?>"  onerror="nofind(this)">
          </div>
          <p><?php echo $_thread['subject'];?></p>
        </div>
        </a>  
         <?php }}}else{ ?>
        <div class="secondLeftList">
          <div class="secondLeftListImg"> <img class="lazyload" src="/kaifadou/static/images/default.jpg" data-original="<?php echo lang('none');?>   onerror="nofind(this)">
          </div>
          <p><?php echo lang('none');?></p>
        </div>
         <?php } ?>
      </div>
      <!--id1栏目结束--> 

转载请注明原文地址:https://www.wellcms.net/read-642.html
00
最新回复(2)
  • 还有就是 本身h2标签用 <?php echo $_forum['name'];?> 但是栏目名称也不显示。
    回复00
  • 在首页看不到的,也调用不到。

    首页都已经循环出来了,还额外调用的意义是什么呢?
    回复20

    • woshisiyu作者
      2023-04-04 13:34:39
      @燃烧的冰我首页不是没有使用循环嘛,看手册里面有这个可以单独调用某一个板块的,就试试,结果调不出来。所以想是不是我代码哪里有问题

    • 燃烧的冰
      2023-04-04 14:28:32
      @woshisiyu能循环出来,就能调用出来。自己看看哪里出问题了吧。是不是自己写了其他的代码,覆盖了$arrlist