Skip to content

Instantly share code, notes, and snippets.

@MajorRedbeard
Created May 16, 2016 20:16
Show Gist options
  • Save MajorRedbeard/4f8176837cd96351bab405ca11418a2b to your computer and use it in GitHub Desktop.
Save MajorRedbeard/4f8176837cd96351bab405ca11418a2b to your computer and use it in GitHub Desktop.
/*Standard CSS*/
.centered {margin: 0 auto; display: table; text-align: center;}
.hidden {display:none;}
.grid-3 { width: 30%; margin: 1%; display: inline-block; }
.grid-2 { width: 45%; margin: 1%; display: inline-block; }
.grid-1 { width: 100%; display: inline-block; }
<?php
/* GET CUSTOM FIELD */
get_post_meta(get_the_ID(),'FIELDNAME',true); /* "true" at end returns single value, rather than array/serialized string */
/* GET POST / PAGE SLUG */
get_post_field( 'post_name', get_post() );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment