-
-
Save jessedmatlock/57ee59dbb7fcbbe658c8d695db5ccb9d to your computer and use it in GitHub Desktop.
Revisions
-
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,8 +21,9 @@ <?php if(get_field('logo')): ?> <?php $attachment_id = get_field('logo'); $size = 'large'; $image_attributes = wp_get_attachment_image_src( $attachment_id, $size ); // [0] => url // [1] => width // [2] => height -
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ // [0] => url // [1] => width // [2] => height // [3] => boolean: true if $url is a resized image, false if it isn't or no img avail. ?> <?php endif; ?> -
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,10 +23,10 @@ <?php $attachment_id = get_field('logo'); $image_attributes = wp_get_attachment_image_src( $attachment_id ); // [0] => url // [1] => width // [2] => height // [3] => boolean: true if $url is a resized image, false if it is the original or if no image is available. ?> <?php endif; ?> -
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ <?php if(get_field('logo')): ?> <?php $attachment_id = get_field('logo'); $image_attributes = wp_get_attachment_image_src( $attachment_id ); // [0] => url // [1] => width // [2] => height -
kisabelle revised this gist
Mar 16, 2015 . No changes.There are no files selected for viewing
-
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,9 @@ <?php echo wp_get_attachment_image( $attachment_id, $size, false, array( 'class' => 'my-class' ) ); ?> /* Get Image Attributes */ <?php if(get_field('logo')): ?> <?php $attachment_id = get_field('logo'); -
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,16 @@ <?php echo wp_get_attachment_image( $attachment_id, $size, false, array( 'class' => 'my-class' ) ); ?> <?php if(get_field('logo')): ?> <?php $attachment_id = get_field('logo'); $image_attributes = wp_get_attachment_image_src( $attachment_id ); // [0] => url // [1] => width // [2] => height // [3] => boolean: true if $url is a resized image, false if it is the original or if no image is available. ?> <?php endif; ?> /*----------------------------------------------*/ -
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -133,9 +133,15 @@ <?php /*----------------------------------------------*/ /* User Fields /*----------------------------------------------*/ // The $post_id needed is a string containing “user” + the user ID in this format: “user_$UserID” $variable = get_field('field_name', 'user_2'); // do something with $variable -
kisabelle revised this gist
Mar 16, 2015 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -121,5 +121,22 @@ // no layouts found endif; /*----------------------------------------------*/ /* Page Link /*----------------------------------------------*/?> <a href="<?php the_field('page_link'); ?>">Read this!</a> <?php ?> -
kisabelle revised this gist
Jun 26, 2014 . 1 changed file with 34 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -89,4 +89,37 @@ 'compare' => 'LIKE' ) ) )); /*----------------------------------------------*/ /* Flexible Content Field /*----------------------------------------------*/ <?php // check if the flexible content field has rows of data if( have_rows('flexible_content_field_name') ): // loop through the rows of data while ( have_rows('flexible_content_field_name') ) : the_row(); if( get_row_layout() == 'paragraph' ): the_sub_field('text'); elseif( get_row_layout() == 'download' ): $file = get_sub_field('file'); endif; endwhile; else : // no layouts found endif; ?> -
kisabelle revised this gist
Apr 30, 2014 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -75,8 +75,6 @@ //... } /* * 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) -
kisabelle revised this gist
Apr 30, 2014 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -65,6 +65,18 @@ /* 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) -
kisabelle revised this gist
Apr 30, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -65,6 +65,12 @@ /* Checkbox Field /*----------------------------------------------*/ /* * 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( -
kisabelle revised this gist
Apr 30, 2014 . 1 changed file with 26 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ /*----------------------------------------------*/ /* Image Field /*----------------------------------------------*/ /* Return value: Attachment ID */ @@ -15,7 +17,11 @@ <?php echo wp_get_attachment_image( $attachment_id, $size, false, array( 'class' => 'my-class' ) ); ?> /*----------------------------------------------*/ /* Repeater Field /*----------------------------------------------*/ <?php @@ -50,4 +56,21 @@ <?php else : ?> <?php endif; ?> /*----------------------------------------------*/ /* Checkbox Field /*----------------------------------------------*/ $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' ) ) )); -
kisabelle revised this gist
Feb 18, 2014 . 1 changed file with 15 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -36,4 +36,18 @@ endif; ?> /* Repeater Field Alternate Syntax/Markup */ <?php if( have_rows('repeater_field_name') ): ?> <?php while ( have_rows('repeater_field_name') ) : the_row(); ?> <?php the_sub_field('sub_field_name'); ?> <?php endwhile; ?> <?php else : ?> <?php endif; ?> -
kisabelle revised this gist
Feb 13, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,10 @@ ?> <?php endif; ?> /* Add A Class to the Img tag */ <?php echo wp_get_attachment_image( $attachment_id, $size, false, array( 'class' => 'my-class' ) ); ?> /* Repeater Field */ -
kisabelle revised this gist
Jan 22, 2014 . 1 changed file with 25 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,28 @@ $size = "vendor-logo"; // (thumbnail, medium, large, full or custom size) echo wp_get_attachment_image( $attachment_id, $size ); ?> <?php endif; ?> /* Repeater Field */ <?php // check if the repeater field has rows of data if( have_rows('repeater_field_name') ): // loop through the rows of data while ( have_rows('repeater_field_name') ) : the_row(); // display a sub field value the_sub_field('sub_field_name'); endwhile; else : // no rows found endif; ?> -
kisabelle created this gist
Jan 16, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ /* Image Field */ /* Return value: Attachment ID */ <?php if(get_field('logo')): ?> <?php $attachment_id = get_field('logo'); $size = "vendor-logo"; // (thumbnail, medium, large, full or custom size) echo wp_get_attachment_image( $attachment_id, $size ); ?> <?php endif; ?>