Posted By

dloop on 09/12/10


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

manavecplan
athanassiadis
booski


Wordpress: Custom Field Post or Page Title H1


 / Published in: PHP
 

To create a post or page title that is different than the title above the permalink. :: HOW TO :: in the wordpress post or page administration panel -> custum field panel -> name: "customtitle" // value: "Your Post or Page Title".

  1. <h1>
  2. <?php if (get_post_meta($post->ID, "customtitle", true)) : ?>
  3. <?php $key="customtitle"; echo get_post_meta($post->ID, $key, true); ?>
  4. <?php else : ?>
  5. <?php the_title(); ?>
  6. <?php endif; ?>
  7. </h1>

Report this snippet  

You need to login to post a comment.