WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to add my custom fields after the page title when you view it on the site. How do I do this?



share|improve this question

Use get_post_meta() in the theme template you want to modify. Like so...

<h1>If This Were Your Page Title</h1>
<?php echo get_post_meta(get_the_ID(), 'Your Custom Field Name', true); ?>

Easy peasy. :-)

share|improve this answer
I wish it was, but I'm a dope. Can i add my meta to my theme's page.php? and Where? This is some of the code that's in the file: <?php global $theme; get_header();?> <div id="main"> <?php $theme->hook('main_before');?> <div id="content"> <?php $theme->hook('content_before'); ?> – Meaghan Danzy Mar 7 '13 at 17:38
Check the link I provided for get_post_meta(), which explains it in detail. You can use the function anywhere, and it just needs a post id, the name of your custom field, and whether you want a value or array (true returns a single value, false returns an array). get_the_ID() can be used in just about any page template file (home.php, index.php, single.php, page.php, etc). – Matt van Andel Mar 7 '13 at 18:02
can i add the meta after a theme hook? such as title_after? – Meaghan Danzy Mar 7 '13 at 19:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.