Last active
August 29, 2015 14:17
-
-
Save blickwert/ad01af4c2e664d2bd121 to your computer and use it in GitHub Desktop.
Genesis - ACF Field on Front_page (Before Content)
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 characters
<?php /** | |
* Genesis Before Content | |
* | |
* @author David Wögerer | |
* @since 2.1.2 | |
* | |
*/ | |
add_action( 'genesis_before_content', 'widget_before_content' ); | |
function widget_before_content() { | |
if ( is_front_page() ) { ?> | |
<aside class="column-3"> | |
<?php $repeater_rows = get_field('repeater_pagelink'); | |
$num = 0; | |
foreach ($repeater_rows as $repeater_row) { | |
$num++; | |
// var_dump($repeater_row); | |
$params = array( 'width' => 250, 'height' => 250, 'crop' => true ); | |
$imageurl = wp_get_attachment_url ( $repeater_row['image_pagelink'] ); | |
$imageurl = bfi_thumb( $imageurl, $params ); ?> | |
<a class="col<?php echo $num; ?>" style="background-image:url(<?php echo $imageurl; ?>);" href="<?php echo get_permalink( $repeater_row['url_pagelink'] ); ?>"> | |
<div> | |
<span class="text1"><?php echo $repeater_row['text']; ?></span> | |
<span class="text2"><?php echo $repeater_row['text2']; ?></span> | |
</div> | |
</a> | |
<?php } ?> | |
</aside> | |
<?php } | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment