Free web hosting music - CHAPTER 17 CUSTOMIZING YOUR BLOG S LAYOUT 469
CHAPTER 17 CUSTOMIZING YOUR BLOG S LAYOUT 469 Listing 17-8. Using the Class Variable in main-content.php
Notice a couple of big changes here. First, all the PHP code is inside one block. You don t need to include each line of PHP inside its own tags. You can amalgamate multiple PHP lines. This works well in this case because there is no longer any HTML code mixed in. Second, you use the WordPress template function is_singleto test if the reader is viewing a single post. If the function returns true, then you set your CSS class variable to main-content-full. If it is not true, the else part of the clause is executed, setting the CSS class variable to the normal main-content-norm. The main-content building block isn t included. Then you test again whether you are viewing a single page. This time the test is negative. The exclamation mark in front of the is_single function negates the test. This test means, If the page is not a single
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.