php函数
wordpress会封装一部分函数,比如bloginfo该函数的作用是直接调用你设置的你的网站的名称
示例
php
This is our amazing custom theme
<?php
echo 2+2;
function myfirstfunction(){
echo 3+3;
echo "<p>Hello ,this is my first function</p>";
echo "<p>it can't understand chinese</p>";
}
myfirstfunction();
myfirstfunction();
function greet($name,$color){
echo "<p>Hi,my name is $name and my favorite color is $color</p>";
}
greet('John','blue');
greet('Jane','green');
?>
<h1><?php
bloginfo('name');
?></h1>
<p>
<?php
bloginfo('description');
?>
</p>