Skip to content

Instantly share code, notes, and snippets.

@gareth-gillman
Created June 13, 2016 13:48
Show Gist options
  • Save gareth-gillman/3b4869435ce92ac85b82c49a8cdcbbc6 to your computer and use it in GitHub Desktop.
Save gareth-gillman/3b4869435ce92ac85b82c49a8cdcbbc6 to your computer and use it in GitHub Desktop.
FullpageJS in WordPress
<div id="fullpage">
<?php
$args = array(
'sort_column' => 'menu_order'
);
$pages = get_pages($args);
$i = 0;
foreach ( $pages as $page ) {
?>
<div class="section <?php if($i=='1'){echo 'active'}; ?>" id="<?php echo $page->post_name; ?>">
<?php echo $page->post_content; ?>
</div>
<?php
$i++;
}
?>
</div>
function my_scripts() {
if ( !is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_style( 'fullpagecss', trailingslashit( get_template_directory_uri() ) . 'css/jquery.fullPage.css', array(), '2.8.1', 'all' );
wp_enqueue_script('fullpagejs', trailingslashit( get_template_directory_uri() ) . '/js/jquery.fullPage.min.js', array('jquery'), array(), '2.8.1', true );
}
}
add_action( 'wp_print_scripts', 'my_scripts');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment