Skip to content

Instantly share code, notes, and snippets.

@jamieschmid
Last active August 29, 2015 14:24
Show Gist options
  • Save jamieschmid/8c72e7aeef32c70ec1e5 to your computer and use it in GitHub Desktop.
Save jamieschmid/8c72e7aeef32c70ec1e5 to your computer and use it in GitHub Desktop.
Advanced Custom Fields gists
if( function_exists('acf_add_options_page') ) {
$page = array(
'page_title' => 'Header',
'menu_title' => 'Header',
'menu_slug' => 'header',
'capability' => 'edit_posts',
'redirect' => false,
'position' => '3.3'
);
acf_add_options_page( $page );
}
<?php the_field('field_name', 123); ?>
add_action( 'wp_enqueue_scripts', 'jk_masonry' );
function jk_masonry() {
wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) );
}
<?php if( have_rows('repeater', 123) ): ?>
<ul>
<?php while( have_rows('repeater', 123) ): the_row(); ?>
<li><?php the_sub_field('title'); ?></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment