Skip to content

Instantly share code, notes, and snippets.

@jackfearing
Last active October 16, 2019 22:13
Show Gist options
  • Save jackfearing/1b6ee0d8168210cbe486894df48f2105 to your computer and use it in GitHub Desktop.
Save jackfearing/1b6ee0d8168210cbe486894df48f2105 to your computer and use it in GitHub Desktop.
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'Your-Custom-Field', true);
wp_reset_query();
?>
<?php echo get_post_meta( get_the_ID(), 'custom_field_name', true ) ?>
<?php if ( get_field( 'custom_field_name' ) == 1 ) { echo 'content_name_or_class_name'; } ?>
<?php if ( get_post_meta( get_the_ID(), 'custom_field_name', true ) == 1 ) {
//echo 'true';
} else {
//echo 'false';
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment