Li Yang's personal blog template demonstration station

Theme template demonstration station, there must be one you like

Z-blogPHP call article, the first tutorial with different styles

Actually, I planned to get a cms long ago However, due to its own time and technical constraints, there has always been a problem that has not been solved. It is to call an article under a certain column. The first article has a different arrangement style from other articles. For example, the current blog of our site calls five articles, of which the first article is different from the other four, or it looks better like this, do you think?

 Blog cms Layout.jpg

I also thought about using other methods to solve the problem, but none of them was ideal. Too much code piled up affected the speed of the website, which went against the original intention of doing the theme. I finally learned this skill a few days ago, and I saw it in the Tianxing blog tutorial, so Brieflee The theme has come out. If you have time today, write this tutorial. If you need it, you can take it away. Don't talk nonsense. The graphic tutorial begins:

 {foreach GetList(5,10) as $key=>$article} {$i=$key} {if $i==0}   <li class="title-img"><a href="{$article.Url}" title="{$article.Title}" target="_blank"><img src="{$article.Img}" alt="{$article.Title}"></a>     {php}$intro= preg_replace('/[\r\n]+/', '', trim(SubStrUTF8(TransferHTML($related->Intro,'[nohtml]'),66)).'...'); {/php}     <p>{$intro}</p></li> {else}     <li><span class="sp-time">{$article.Time('Y-m-d')}</span><span class="sp-title"><a href="{$article.Url}" target="_blank">{$article.Title}</a></span></li> {/if} {/foreach}

Copy the code, and directly modify the number of calls and classification ID of the article (5 is the number of calls, 10 is the classification ID of calls)

design sketch:

 Li Yang Blog Demo.png

As for the style, you can modify it according to the theme style.

  • Comment List

Comment:

◎ Welcome to participate in the discussion. Please express your views and exchange your views here.

Powered By Z-BlogPHP 1.7.2

Copyright 2015-2016  LiBlog.Cn.  All Rights Reserved.  Liao ICP Bei No. 15015379