Best practice for using template tags
-
I don’t want to run PHP inside posts.
So the only solution when I need a template tag is to create a new template for it?! This seems awkward. It results in content being splattered around — some content in your template files, some in your DB.
Example show below: using <?php bloginfo(‘admin_email’) ?>
on contact page requires creating a whole new template,
creating a page in DB, then assigning template to the page.If anyone can clue me to a less convoluted approach, I will be grateful. I am new here. Thank you.
===start example
<?php
/*
Template Name: Contact
*/
?><?php get_header(); ?>
<h1><?php the_title(); ?></h1>
<p>Please email us with any questions: <?php bloginfo(‘admin_email’) ?></p><?php get_footer(); ?>
- The topic ‘Best practice for using template tags’ is closed to new replies.