php require_once() function
I’m trying to figure out how to eliminate redundant code by using includes. For example, a theme that I’m working on has the following meta info for each post:
<p class="postmeta"><?php the_time('M j, Y'); ?> | <?php the_author(); ?> | <?php the_category(', ') ?> | <a href="<?php comments_link(); ?>" class="comments">Comments (<?php comments_number('0','1','%'); ?>)</a></p>
This code is located in several theme files so if I want to rearrange items (e.g., place the author before the date), I would have to edit the same code in multiple places. The ability to use includes would make updates such as this much easier. Please help…
- The topic ‘php require_once() function’ is closed to new replies.