typecho教程:QDM首页调用代码
QDM首页调用代码
12-30
<?php /** * 这是 前端美 在2016年设计的一款新主题 * * @package QDM-2016 * @author Typecho Team * @version 2.016 * @link http://55.show/ */ if (!defined('__TYPECHO_ROOT_DIR__')) exit; $this->need('header.php'); ?> <main id="main" class="vpsmm-main"> <?php if (($this->_currentPage == 1)): ?> <?php while($this->next()): ?> <?php if (($this->sequence == 1)): ?> <div class="posts-box posts-box-1" data-wyy-type="t1_0"><div class="posts-wrapper row"> <div class="col-sm-8 col-left"> <article class="post-summary psum-featured post-format-standard"> <div class="post-image"> <a href="<?php%20$this->permalink();%20?>" title="<?php $this->title() ?>"> <img width="490" height="323" src="<?php%20$this->fields->img();%20?>_490x323.jpg" class="attachment-wyy-md wp-post-image" alt="<?php $this->title() ?>"> </a> </div><!-- .post-image --> <div class="post-details"> <h2 class="post-title"> <a href="<?php%20$this->permalink();%20?>"><?php $this->title() ?></a> </h2> <p class="post-excerpt"><?php if (isset($this->fields->disc)): ?><?php $this->fields->disc(); ?><?php else: ?><?php $this->excerpt(35, '……'); ?><?php endif; ?></p> <ul class="post-meta no-sep"> <li class="post-date"> <span class="fa fa-clock-o"></span><?php $this->date(); ?></li> </ul><!-- .post-meta --> </div><!-- .post-details --> </article> </div> <div class="col-sm-4 col-right"> <div class="row"> <?php else: ?> <?php if (($this->sequence == 2)): ?> <div class="col col-sm-12 col-xs-6"> <article class="post-summary psum-small post-format-standard"> <div class="post-image"> <a href="<?php%20$this->permalink();%20?>" title="<?php $this->title() ?>"> <img width="360" height="238" src="<?php%20$this->fields->img();%20?>_360x238.jpg" class="attachment-wyy-md wp-post-image" alt="<?php $this->title() ?>"> </a> </div><!-- .post-image --> <div class="post-details"> <h2 class="post-title"> <a href="<?php%20$this->permalink();%20?>"><?php $this->title() ?></a> </h2> <ul class="post-meta no-sep"> <li class="post-date"> <span class="fa fa-clock-o"></span><?php $this->date(); ?></li> </ul><!-- .post-meta --> </div><!-- .post-details --> </article> </div> <?php else: ?> <?php if (($this->sequence == 3)): ?> <div class="col col-sm-12 col-xs-6"> <article class="post-summary psum-small post-format-standard"> <div class="post-image"> <a href="<?php%20$this->permalink();%20?>" title="<?php $this->title() ?>"> <img width="360" height="238" src="<?php%20$this->fields->img();%20?>_360x238.jpg" class="attachment-wyy-md wp-post-image" alt="<?php $this->title() ?>"> </a> </div><!-- .post-image --> <div class="post-details"> <h2 class="post-title"> <a href="<?php%20$this->permalink();%20?>"><?php $this->title() ?></a> </h2> <ul class="post-meta no-sep"> <li class="post-date"> <span class="fa fa-clock-o"></span><?php $this->date(); ?></li> </ul><!-- .post-meta --> </div><!-- .post-details --> </article> </div> </div></div></div></div> <div class="posts-box posts-box-2" data-wyy-type="t2_1" data-wyy-post-not=""> <div class="box-header has-title"><h2 class="title">Latest News</h2></div> <div class="posts-wrapper"> <?php else: ?> <article class="post-summary psum-horizontal post-format-standard clearfix"> <div class="post-image"> <a href="<?php%20$this->permalink()%20?>" title="<?php $this->title() ?>"> <img src="<?php%20Fimg_Plugin::showfimg($this->cid,1);?>_480x190.jpg" class="attachment-wyy-md wp-post-image" alt="" /> </a> </div><!-- .post-image --> <div class="post-details"> <h2 class="post-title"> <a href="<?php%20$this->permalink()%20?>"><?php $this->title() ?></a> </h2> <p class="post-excerpt"><?php $this->excerpt(100, '……'); ?></p> <ul class="post-meta no-sep"> <li class="post-date"> <span class="fa fa-clock-o"></span><?php $this->date('F j, Y'); ?></li> </ul><!-- .post-meta --> </div><!-- .post-details --> </article> <?php endif; ?><?php endif; ?><?php endif; ?> <?php endwhile; ?> </div></div> <?php else: ?><!--判断是否为第1页--> <div class="posts-box posts-box-2" data-wyy-type="t2_1" data-wyy-post-not=""> <div class="box-header has-title"><h2 class="title">Latest News</h2></div> <div class="posts-wrapper"> <?php while($this->next()): ?> <article class="post-summary psum-horizontal post-format-standard clearfix"> <div class="post-image"> <a href="<?php%20$this->permalink()%20?>" title="<?php $this->title() ?>"> <img src="<?php%20Fimg_Plugin::showfimg($this->cid,1);?>_480x190.jpg" class="attachment-wyy-md wp-post-image" alt="" /> </a> </div><!-- .post-image --> <div class="post-details"> <h2 class="post-title"> <a href="<?php%20$this->permalink()%20?>"><?php $this->title() ?></a> </h2> <p class="post-excerpt"><?php $this->excerpt(100, '……'); ?></p> <ul class="post-meta no-sep"> <li class="post-date"> <span class="fa fa-clock-o"></span><?php $this->date('F j, Y'); ?></li> </ul><!-- .post-meta --> </div><!-- .post-details --> </article> <?php endwhile; ?> </div></div> <?php endif; ?> <div class="pagination"><?php $this->pageNav('PREV', 'NEXT' , '1', ''); ?></div> </main> <?php $this->need('sidebar.php'); ?> <?php $this->need('footer.php'); ?>