Custom fields on index.php
-
I’m tying to use WP as a CMS system as well as a blog for a “Projects” section. I have a static front page, and it is set up like this:
Front page displays: A static page
Front page: Home
Posts page: Latest ProjectsHome is using a file called “template_home.php”, and the posts page for Latest Projects is using “index.php”
When editing a page, I have a custom field used for a description of the page. Too pull this data in, I use this code on both pages, in exactly the same place:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_meta(); ?> <?php endwhile; endif; ?>
This works perfectly for “template_home.php”, but for “index.php” the custom field content will not show up.
To clarify, “template_home.php” and “index.php” have the code above in exactly the same place, and there are only minor differences between “index.php” and “template_home.php”.
Is there something I am missing to why it wont work on the page with the blog posts?
Thanks.
- The topic ‘Custom fields on index.php’ is closed to new replies.