今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Loops
- [Instructor] Loops are a fundamental part of PHP and WordPress specifically. In fact, the important portion of WordPress code is actually called the loop. And we'll look at two types of loops, while loops and foreach loops. But first, let's look at what they are. An if statement will execute a piece of code once if a condition is true, but loops will continue to execute a piece of code until the condition becomes false. There are lots of applications for loops, like enumerating, performing repetitive math, and listing a set of items, but in WordPress, loops are most often used to process arrays. Now before we get into actual code examples, let's look at the structure of each. While loops will do something while a condition is true, and these are general-purpose loops used for math, enumeration, or anything that you can think of. Foreach loops are loops that do something for each item in a list, and these are used to process…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
Comparison operators and the truth4 分钟 26 秒
-
(已锁定)
Logical operators5 分钟 55 秒
-
(已锁定)
Creating if/else statements6 分钟 53 秒
-
(已锁定)
Conditional tags in WordPress1 分钟 19 秒
-
(已锁定)
Loops7 分钟 56 秒
-
(已锁定)
The Loop in WordPress2 分钟 54 秒
-
(已锁定)
Challenge: Loop through an array of information1 分钟 18 秒
-
(已锁定)
Solution: Loop through an array of information5 分钟 28 秒
-
-
-
-