Last active
October 16, 2019 22:13
-
-
Save jackfearing/1b6ee0d8168210cbe486894df48f2105 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_query; | |
$postid = $wp_query->post->ID; | |
echo get_post_meta($postid, 'Your-Custom-Field', true); | |
wp_reset_query(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo get_post_meta( get_the_ID(), 'custom_field_name', true ) ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( get_field( 'custom_field_name' ) == 1 ) { echo 'content_name_or_class_name'; } ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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