Creating your first template

Template engines allow us to use pure HTML files or any other file type for templates. However, we are only using a template loader, and therefore we need some PHP code inside the templates. So, let's create the first template file called topic-meta-template.php inside the templates folder for topic metadata. We will be replacing the PHP variable based template code we used earlier with the template loader. Here, we have the complete template code for the topic meta box:

     <?php      global $template_data;      extract($template_data);    ?>    <input type="hidden" name="topic_meta_nonce" value="<?php echo $topic_meta_nonce; ?>" />    <table class="form-table">      <tr> <th style=''><label><?php _e('Sticky Status','wpwaf'); ?>* </label></th> ...

Get Wordpress Web Application Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.