Skip to content

Instantly share code, notes, and snippets.

@mzo84
Created August 15, 2016 11:46
Show Gist options
  • Save mzo84/0d53ec2e6b66b786df9258b55c01dc33 to your computer and use it in GitHub Desktop.
Save mzo84/0d53ec2e6b66b786df9258b55c01dc33 to your computer and use it in GitHub Desktop.
wordpress - custom field on page
// 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