array(
'footer-column-1-widget-area' => array(
'recent-comments'
),
'footer-column-2-widget-area' => array(
'recent-posts'
),
'footer-column-3-widget-area' => array(
'calendar'
),
),
'posts' => array(
'home',
'blog',
'about',
'contact'
),
// Default to a static front page and assign the front and posts pages.
'options' => array(
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}',
),
// Set the front page section theme mods to the IDs of the core-registered pages.
'theme_mods' => array(
'all2_slider_display' => 1,
'all2_slide1_image' => esc_url( get_stylesheet_directory_uri() . '/images/slider/1.jpg' ),
'all2_slide2_image' => esc_url( get_stylesheet_directory_uri() . '/images/slider/2.jpg' ),
'all2_slide3_image' => esc_url( get_stylesheet_directory_uri() . '/images/slider/3.jpg' ),
),
'nav_menus' => array(
// Assign a menu to the "primary" location.
'primary' => array(
'name' => __( 'Primary Menu', 'all2' ),
'items' => array(
'link_home',
'page_blog',
'page_contact',
'page_about',
),
),
// Assign a menu to the "footer" location.
'footer' => array(
'name' => __( 'Footer Menu', 'all2' ),
'items' => array(
'link_home',
'page_about',
'page_blog',
'page_contact',
),
),
),
);
$starter_content = apply_filters( 'all2_starter_content', $starter_content );
add_theme_support( 'starter-content', $starter_content );
}
endif; // all2_setup
add_action( 'after_setup_theme', 'all2_setup' );
add_action( 'wp_enqueue_scripts', 'all2_enqueue_styles' );
function all2_enqueue_styles() {
wp_enqueue_style( 'allingrid-stylesheet', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'all2-child-style', get_stylesheet_uri(), array( 'all2-stylesheet' ) );
}
function all2_load_scripts() {
wp_enqueue_script( 'pgwslideshow-js',
get_stylesheet_directory_uri() . '/js/pgwslideshow.js',
array('jquery') );
wp_enqueue_script( 'all2-js', get_stylesheet_directory_uri() . '/js/all2.js',
array( 'jquery', 'pgwslideshow-js' ) );
}
add_action( 'wp_enqueue_scripts', 'all2_load_scripts' );
if ( ! function_exists( 'all2_display_slider' ) ) :
/**
* Displays the slider
*/
function all2_display_slider() { ?>
add_section(
'all2_slider_section',
array(
'title' => __( 'Slider', 'all2' ),
'capability' => 'edit_theme_options',
)
);
// Add display slider option
$wp_customize->add_setting(
'all2_slider_display',
array(
'default' => 0,
'sanitize_callback' => 'all2_sanitize_checkbox',
)
);
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'all2_slider_display',
array(
'label' => __( 'Display Slider on a Static Front Page', 'all2' ),
'section' => 'all2_slider_section',
'settings' => 'all2_slider_display',
'type' => 'checkbox',
)
)
);
for ($i = 1; $i <= 3; ++$i) {
$slideImageId = 'all2_slide'.$i.'_image';
$defaultSliderImagePath = get_stylesheet_directory_uri().'/images/slider/'.$i.'.jpg';
// Add Slide Image
$wp_customize->add_setting( $slideImageId,
array(
'default' => $defaultSliderImagePath,
'sanitize_callback' => 'all2_sanitize_url'
)
);
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $slideImageId,
array(
'label' => sprintf( esc_html__( 'Slide #%s Image', 'all2' ), $i ),
'section' => 'all2_slider_section',
'settings' => $slideImageId,
)
)
);
}
}
endif; // all2_customize_register
add_action('customize_register', 'all2_customize_register');