Skip to content

Instantly share code, notes, and snippets.

@anant1811
Last active December 4, 2019 06:54
Show Gist options
  • Save anant1811/241c2533b69cf5b8e271b16323d6e30d to your computer and use it in GitHub Desktop.
Save anant1811/241c2533b69cf5b8e271b16323d6e30d to your computer and use it in GitHub Desktop.
ACF with Genesis Page templates
<?php
/**
* ACF compatible genesis page template
*
* @author StudioPress
* @package Altitude
* @subpackage Customizations
*/
/*
Template Name: ACF Genesis
*/
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Remove 'site-inner' from structural wrap
add_theme_support( 'genesis-structural-wraps', array( 'header', 'menu-secondary', 'footer-widgets', 'footer' ) );
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
// Homepage CUSTOM LOOP
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'my_custom_loop' );
function my_custom_loop () {
?>
<div id="full_container">
<div class="acf-field-1"><p><?php the_field('field_1_name'); ?></p></div>
<div class="acf-field-2"><p><?php the_field('field_2_name'); ?></p></div>
<div class="acf-field-3"><p><?php the_field('field_3_name'); ?></p></div>
</div> <!-- end main container -->
<?php } ?>
<?php genesis(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment