Advertisement
napolux

Get custom field named "subtitle" in WordPress

May 7th, 2015
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.15 KB | None | 0 0
  1. $subtitle = get_post_meta( get_the_ID(), 'subtitle', true );
  2. // check if the custom field has a value
  3. if( ! empty( $subtitle ) ) {
  4.   echo $subtitle;
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement