Skip to content

Instantly share code, notes, and snippets.

@davemac
Created August 27, 2012 01:13

Revisions

  1. davemac revised this gist Aug 27, 2012. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    <?php elseif ( has_post_thumbnail() ) :
    $featured_image_link = ( get_field( 'featured_image_links_to' ) );
    if ( $featured_image_link ) :
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if ( has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    echo '</a>';
    elseif :
    if ( $featured_image_link ) {
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if ( has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    echo '</a>';
    } else {
    the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) );
    endif;
    };
    endif; ?>
  2. davemac revised this gist Aug 27, 2012. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,9 @@
    <?php elseif ( has_post_thumbnail() ) :
    $featured_image_link = (get_field('featured_image_links_to') );
    $featured_image_link = ( get_field( 'featured_image_links_to' ) );
    if ( $featured_image_link ) :
    foreach (get_field('featured_image_links_to') as $post_object):
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if(has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    if ( has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    echo '</a>';
    endforeach;
    elseif :
    the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) );
    endif;
  3. davemac revised this gist Aug 27, 2012. 1 changed file with 12 additions and 8 deletions.
    20 changes: 12 additions & 8 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,12 @@
    <?php if ( has_post_thumbnail() ) :

    foreach (get_field('featured_image_links_to') as $post_object):
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if(has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    echo '</a>';
    endforeach;
    endif; ?>
    <?php elseif ( has_post_thumbnail() ) :
    $featured_image_link = (get_field('featured_image_links_to') );
    if ( $featured_image_link ) :
    foreach (get_field('featured_image_links_to') as $post_object):
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if(has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    echo '</a>';
    endforeach;
    elseif :
    the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) );
    endif;
    endif; ?>
  4. davemac revised this gist Aug 27, 2012. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,8 @@
    <?php if ( has_post_thumbnail() ) :

    if (get_field('featured_image_links_to') :
    foreach (get_field('featured_image_links_to') as $post_object):
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if (has_post_thumbnail()) { the_post_thumbnail( 'hero-image-med' ); }
    echo '</a>';
    endforeach;
    endif;
    foreach (get_field('featured_image_links_to') as $post_object):
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if(has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); }
    echo '</a>';
    endforeach;
    endif; ?>
  5. davemac created this gist Aug 27, 2012.
    10 changes: 10 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <?php if ( has_post_thumbnail() ) :

    if (get_field('featured_image_links_to') :
    foreach (get_field('featured_image_links_to') as $post_object):
    echo '<a href="'.get_permalink($post_object->ID) .'">';
    if (has_post_thumbnail()) { the_post_thumbnail( 'hero-image-med' ); }
    echo '</a>';
    endforeach;
    endif;
    endif; ?>