Created
August 15, 2016 11:46
-
-
Save mzo84/0d53ec2e6b66b786df9258b55c01dc33 to your computer and use it in GitHub Desktop.
wordpress - custom field on page
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
// when adding a custom field to a page, you can check its value like this: | |
<?php // e.g conditional sidebar display | |
if (!get_post_meta($post->ID, "noSidebar", true)) { | |
get_sidebar(); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment