Conditional Statements in WordPress 3 Child Themes


show more Using conditional statements for customized effects provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress 3: Building Child Themes show less
please wait ...

Using conditional statements for customized effects

In the previous movie we created a custom page template and remove the title from that template. However, the method I showed was a rather crude one. I copied a bunch of code, this code here, from a different template file, the contents-page.php file and pasted it directly into my custom page template. This is a quick and dirty way of doing things, but it's not necessarily the most effective way of doing it. Now I am going to show you a much cleaner and just as quick way of doing the same thing.

Rather than copying and pasting the code, I am going to use one of the many conditional tags built into WordPress, to test to see if were using a custom page template and then display the content accordingly. Conditional tags are simple if then statements that can help you consolidate a lot of code into a single template file, and that have the computer figure out what to display, and where to display it, and when to display it. The first thing I am going to do is reset my and no-...

Using conditional statements for customized effects
Video duration: 5m 41s 3h 11m Intermediate Updated Nov 27, 2012

Viewers:

Using conditional statements for customized effects provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress 3: Building Child Themes

Subject:
Web
Software:
WordPress
Author:
please wait ...