Last update at :2024-06-12,Edit by888u
Nowadays, with the advent of CMS, building a website has become very easy. We basically don’t need to be too proficient in scripting languages. As long as we are familiar with the simple HTML language, we can complete the production of templates. At present, Snail has basically given up on building websites with WORDPRESS (Chinese websites). And prepare to be familiar with and proficient in the mainstream, niche and lightweight TYPECHO and ZBLOG PHP programs in mainland China. In the previous "Commonly used Typecho theme calling scripts and techniques", we sorted out the calling scripts that are commonly used when making TYPECHO themes, and then also made the first TYPECHO theme.
Today Snail uses this article to organize the commonly used ZBLOG PHP theme template tag calling documents so that they can be copied directly when used in the future.
First, content page breadcrumb navigation
{if $article.Type==ZC_POST_TYPE_ARTICLE}Current location: Homepage - {if $article.Category.ParentID > 0}{template :post-nav}{else}>> {$article.Category.Name}{/if}{/if}Placed in the single.php article, it is judged to call the breadcrumb navigation in the content page.
Second, call the first image of the content as a thumbnail
{php} $pattern=\\\"//\\\"; $content = $article->Content; preg_match_all($pattern,$content,$matchContent); if($matchContent[1][0]) $ temp=$matchContent[1][0]; else $temp=\\\"$host/zb_users/theme/$theme/style/img/pic.png\\\"; //Default picture{/php}< a href=\\\"{$article.Url}\\\" title=\\\"{$article.Title}\\\">This has many uses. For example, it is used to create graphic themes to call the first image or to display the default image when there is no image, so there is no need to use a plug-in. It is important to note that images are best defined in size.
Third, TITLE/keyword/description call
{if $type==\\\'index\\\'&&$page==\\\'1\\\'}{$name}-{$title}{elseif $type==\\\'article \\\'}{$title} _ {$name}Content,\\\'[nohtml]\\\'),80)).\\\'...\\\');{/php} \\\" />{else}{$title} _ {$name}{/if}{$header}Generally, I use this document as the head call of HEAD, which can define the title and page description.
Fourth, category list call
{foreach GetList(number of calls, category ID) as $related}If there is any special need to sort it out, continue to add.
Recommended site search: free virtual host application, independent ip space, free second-level domain name, ip168, domain name query official website, free server Zhenjiang high-defense server, registration password retrieval, domain name and host, vps to ip,
发表评论