Support » Fixing WordPress » Custom field problem – what is result when there is no key for that post

  • I wanna have title to be my custom field.But if i forgot to set custom field key for that post i wanna title for i would like seo_title_tag() function to display the title.

    So when there is no custom field(key) what is the result … what is the value of $key.

    This is the value i want to put instead of THEREISNOKEY

    my code:
    <?php

    $key=”title_tag”if ( $key==”THEREISNOKEY” ) { seo_title_tag(); } else { echo

    get_post_meta($post->ID, $key, true);

    ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom field problem – what is result when there is no key for that post’ is closed to new replies.