/*----------------------------------------------*/ /* Image Field /*----------------------------------------------*/ /* Return value: Attachment ID */ /* Add A Class to the Img tag */ 'my-class' ) ); ?> /* Get Image Attributes */ url // [1] => width // [2] => height // [3] => boolean: true if $url is a resized image, false if it isn't or no img avail. ?> /*----------------------------------------------*/ /* Repeater Field /*----------------------------------------------*/ /* Repeater Field Alternate Syntax/Markup */ /*----------------------------------------------*/ /* Checkbox Field /*----------------------------------------------*/ /* * Conditional statement (Checkbox rvalue is an array) */ if( in_array( 'red', get_field('field_name') ) ) { //... } /* * Query posts for a checkbox value. * This method uses the meta_query LIKE to match the string "red" to the database value a:2:{i:0;s:3:"red";i:1;s:4:"blue";} (serialized array) * The above value suggests that the user selected "red" and "blue" from the checkbox choices */ $posts = get_posts(array( 'meta_query' => array( array( 'key' => 'field_name', // name of custom field 'value' => '"red"', // matches exaclty "red", not just red. This prevents a match for "acquired" 'compare' => 'LIKE' ) ) )); /*----------------------------------------------*/ /* Flexible Content Field /*----------------------------------------------*/ Read this!