WordPress template theme imitation station development tutorial three-wordpress basic settings and system parameter call

WordPress template theme imitation station development tutorial three-wordpress basic settings and system parameter call

In the third chapter of the wordpress template theme imitation site development tutorial, the road of custom wordpress development is officially started, and a template theme of our own is developed. This chapter mainly explains the calling method of some basic parameters of the website.

 Before doing theme development, enable our newly created theme file in our WordPress background theme. Then create a new functions.php file under the theme, register and open the sidebar and friendship link

1. WordPress homepage template theme imitation station development public parameter call

1. WordPress system parameter call label

<? bloginfo('charset'); ?>                     调用网站编码
<? bloginfo('name'); ?>					       调用网站名称
<? bloginfo('description'); ?>                 调用网站描述
<? bloginfo('stylesheet_url'); ?>              调用主题style.css
<? php bloginfo('template_url'); ?>            绝对路径地址
<? php echo get_option('home'); ?>             调用options表中home字段(potions表是用来存放系统产数的数据变)
<? php get_header(); ?>                        wordpress钩子调用公共头部
<? php get_footer(); ?>                        wordpress钩子调用公共底部
<? php get_sidebar(); ?>                       wordpress钩子调用侧边栏
<? php get_template_part( 'link' ); ?>         wordpress钩子调用自定义link.php
<? php get_template_part( 'link', 'head' ); ?> wordpress钩子调用自定义link.php不存在调用head.php
<?php   /*Template Name: about*/  ?>           自定义模板调用, 在自定义模板头部添加
<?php wp_list_bookmarks( $args );?>                    友情链接调用

2. Wordpress system parameter call case-file index.php

<!DOCTYPE html>
<html>
 <head> 
  <meta charset="<? bloginfo('charset'); ?>  ">
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0" /> 
  <title><? bloginfo('name'); ?></title> 
  <meta name="Description" content="<? bloginfo('description'); ?> ">
  <link rel="stylesheet" id="wp-block-library-css" href="<?php bloginfo('template_url'); ?>/style/css/dist/block-library/style.min.css" type="text/css"/> 
  <link rel="stylesheet" id="bootstrap-css" href="<?php bloginfo('template_url'); ?>/style/css/bootstrap.min.css" type="text/css" /> 
  <link rel="stylesheet" id="iconfont-css" href="<?php bloginfo('template_url'); ?>/style/css/iconfont.css" type="text/css"/> 
  <link rel="stylesheet" id="style-css" href="<?php bloginfo('template_url'); ?>/style/css/style.css" type="text/css"  /> 
 </head> 
 <body> 
<div class="site-wrapper"> 
<!--  公共头部文件调用 -->
<?php get_header(); ?>
<!--  公共头部文件调用end -->
    


<!--  公共底部文件调用 -->
<?php get_hooter(); ?>
<!--  公共底部文件调用 -->

<!--友情链接-->
<?php wp_list_bookmarks( $args );?>  
</div>
 </body>
</html>

 

 

Guess you like

Origin blog.csdn.net/qq_39339179/article/details/115113130