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(
'all1_slider_display' => 1,
'all1_slide1_image' => esc_url( get_stylesheet_directory_uri() . '/images/slides/1.jpg' ),
'all1_slide1_content' => _x( 'Slide 1 Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Read more', 'Theme starter content', 'all1' ),
'all1_slide2_image' => esc_url( get_stylesheet_directory_uri() . '/images/slides/2.jpg' ),
'all1_slide2_content' => _x( 'Slide 2 Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Read more', 'Theme starter content', 'all1' ),
'all1_slide3_image' => esc_url( get_stylesheet_directory_uri() . '/images/slides/3.jpg' ),
'all1_slide3_content' => _x( 'Slide 3 Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Read more', 'Theme starter content', 'all1' ),
),
'nav_menus' => array(
// Assign a menu to the "primary" location.
'primary' => array(
'name' => __( 'Primary Menu', 'all1' ),
'items' => array(
'link_home',
'page_blog',
'page_contact',
'page_about',
),
),
// Assign a menu to the "footer" location.
'footer' => array(
'name' => __( 'Footer Menu', 'all1' ),
'items' => array(
'link_home',
'page_about',
'page_blog',
'page_contact',
),
),
),
);
$starter_content = apply_filters( 'all1_starter_content', $starter_content );
add_theme_support( 'starter-content', $starter_content );
}
endif; // all1_setup
add_action( 'after_setup_theme', 'all1_setup' );
add_action( 'wp_enqueue_scripts', 'all1_enqueue_styles' );
function all1_enqueue_styles() {
wp_enqueue_style( 'allingrid-stylesheet', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'all1-child-style', get_stylesheet_uri(), array( 'all1-stylesheet' ) );
if ( is_front_page()
&& get_option( 'show_on_front' ) == 'page'
&& get_theme_mod('all1_slider_display', 0) == 1 ) {
$customCSS = '';
$customCSS .= '@media screen and (min-width: 800px) {';
$customCSS .= 'body.home #header-main-fixed:not(.header-main-in-scroll) {background-color:transparent;}';
$customCSS .= 'body.home #header-main-fixed:not(.header-main-in-scroll) #navmain > div > ul > li > a,body.home #header-main-fixed:not(.header-main-in-scroll) h1,body.home #header-main-fixed:not(.header-main-in-scroll) strong {color:#FFF;}';
$customCSS .= 'body.home #header-spacer:not(.header-spacer-in-scroll) {display:none;}';
$customCSS .= '#slider-wrapper {width:100vw;margin-left:calc(-50vw + 50%);margin-top:-3px;}';
$customCSS .= '}';
wp_add_inline_style( 'all1-inline-style', $customCSS );
}
}
function all1_load_scripts() {
wp_enqueue_script( 'slippry', get_stylesheet_directory_uri() . '/js/slippry.js',
array( 'jquery' ) );
wp_enqueue_script( 'all1-js', get_stylesheet_directory_uri() . '/js/all1.js',
array( 'jquery', 'slippry' ) );
}
add_action( 'wp_enqueue_scripts', 'all1_load_scripts' );
if ( ! function_exists( 'all1_display_slider' ) ) :
/**
* Displays the slider
*/
function all1_display_slider() { ?>
add_section(
'all1_slider_section',
array(
'title' => __( 'Slider', 'all1' ),
'capability' => 'edit_theme_options',
)
);
// Add display slider option
$wp_customize->add_setting(
'all1_slider_display',
array(
'default' => 0,
'sanitize_callback' => 'all1_sanitize_checkbox',
)
);
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'all1_slider_display',
array(
'label' => __( 'Display Slider on a Static Front Page', 'all1' ),
'section' => 'all1_slider_section',
'settings' => 'all1_slider_display',
'type' => 'checkbox',
)
)
);
for ($i = 1; $i <= 3; ++$i) {
$slideContentId = 'all1_slide'.$i.'_content';
$slideImageId = 'all1_slide'.$i.'_image';
$defaultSliderImagePath = get_stylesheet_directory_uri().'/images/slides/'.$i.'.jpg';
// Add Slide Content
$wp_customize->add_setting(
$slideContentId,
array(
'sanitize_callback' => 'all1_sanitize_html',
)
);
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, $slideContentId,
array(
'label' => sprintf( esc_html__( 'Slide #%s Content', 'all1' ), $i ),
'section' => 'all1_slider_section',
'settings' => $slideContentId,
'type' => 'textarea',
)
)
);
// Add Slide Background Image
$wp_customize->add_setting( $slideImageId,
array(
'default' => $defaultSliderImagePath,
'sanitize_callback' => 'all1_sanitize_url'
)
);
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $slideImageId,
array(
'label' => sprintf( esc_html__( 'Slide #%s Image', 'all1' ), $i ),
'section' => 'all1_slider_section',
'settings' => $slideImageId,
)
)
);
}
}
endif; // all1_customize_register
add_action('customize_register', 'all1_customize_register');