Skip to content

Instantly share code, notes, and snippets.

@Perun
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Perun/7e7200fb892b2f662ecf to your computer and use it in GitHub Desktop.
Save Perun/7e7200fb892b2f662ecf to your computer and use it in GitHub Desktop.
Benutzerdefiniertes Feld in WordPress außerhalb des Loops ausgeben
<?php
global $wp_query; $postid = $wp_query->post->ID;
if (get_post_meta($postid, 'Zusatztitel', true)) {
echo get_post_meta($postid, 'Zusatztitel', true);
} else {
echo "Ersatztext";
}
wp_reset_query();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment