WORDPRESS There are four include tags: get_header, get_footer,

WORDPRESS There are four include tags: get_header, get_footer, get_sidebar, and get_comments. To make things smarter yet, conditional tags allow you to have a single file react differently depending on what it s supposed to be doing. Let s assume that you want to run a plug-in in the sidebar, but only when the user is viewing the frontpage nowhere else. You simply wrap the plug-in code in a simple if statement such as this one: Plugin Code Goes Here This is extremely useful, as you will see later, in managing, for instance, a sidebar.php file that works across the entire site, yet behaves differently depending on what part of the blog the reader is in. So let s look at them in depth. Template tags Residing both in and out of The Loop, template tags are how WordPress brings informa tion from the recesses of its database to be presented to the user. Examples of places in which you can make use of template tags include headlines, dates, entry content, perma links, and so on. Many template tags can be configured, using parameters passed to WordPress through the template tag s syntax, allowing for a degree of customability. Where a default template tag might look something like this: , you could also pass it some vari ables like this:

‘, ‘

‘); ?>. Each template tag has a different set of possibilities when it comes to customizing; time spent studying the WordPress Codex on template tags (http://codex.wordpress.org/ template_tags) is time saved later when you suddenly need to figure out how to employ some odd combination of template tags. Here s a loop from the frontpage of our default template:

” rel=”bookmark” title=”Permanent Link to “>

Leave a Reply