Friday 19 July 2013

Exploring PHP Basics

In this case, get_info() represents the tag function, which grabs informa-
tion from the database to deliver it to your blog. The information retrieved
depends on what tag function appears between the two PHP commands.

Every PHP command you start requires a stop command. For every <?php,
you must include the closing ?> command somewhere later in the code.
PHP commands structured improperly cause ugly errors on your site, and
they’ve been known to send programmers, developers, and hosting provid-
ers into loud screaming fits. You find a lot of starting and stopping of PHP
throughout the WordPress templates and functions. The process seems as
though it would be resource intensive, if not exhaustive, but it really isn’t.

Always, always make sure that the PHP start and stop commands are sepa-
rated from the function with a single space. You must have a space after

<?php and a space before ?> — if not, the PHP function code doesn’t work. So make sure that the code looks like this: <?php get_info(); ?> — not like this: <?phpget_info();?>

0 comments:

Post a Comment